Просмотр исходного кода

HUE-9377 [ui] Upgrade jest and linters to latest versions

Johan Ahlen 5 лет назад
Родитель
Сommit
ed826b50f1
5 измененных файлов с 571 добавлено и 597 удалено
  1. 52 22
      .eslintrc.js
  2. 3 1
      .prettierrc
  3. 1 1
      jest.config.js
  4. 502 560
      package-lock.json
  5. 13 13
      package.json

+ 52 - 22
.eslintrc.js

@@ -1,20 +1,56 @@
-
 const normalGlobals = [];
 
 const hueGlobals = [
   // global_js_constants.mako
-  'AUTOCOMPLETE_TIMEOUT', 'CACHEABLE_TTL', 'CSRF_TOKEN', 'DOCUMENT_TYPES', 'DROPZONE_HOME_DIR',
-  'ENABLE_SQL_SYNTAX_CHECK', 'HAS_MULTI_CLUSTER', 'HAS_CATALOG', 'HAS_OPTIMIZER', 'HAS_WORKLOAD_ANALYTICS',
-  'HUE_I18n', 'HUE_VERSION', 'IS_K8S_ONLY', 'IS_NEW_INDEXER_ENABLED', 'IS_S3_ENABLED',
-  'isIE11', 'KO_DATERANGEPICKER_LABELS', 'LOGGED_USERGROUPS', 'LOGGED_USERNAME', 'METASTORE_PARTITION_LIMIT',
-  'USER_HOME_DIR', 'WorkerGlobalScope',
+  'AUTOCOMPLETE_TIMEOUT',
+  'CACHEABLE_TTL',
+  'CSRF_TOKEN',
+  'DOCUMENT_TYPES',
+  'DROPZONE_HOME_DIR',
+  'ENABLE_SQL_SYNTAX_CHECK',
+  'HAS_MULTI_CLUSTER',
+  'HAS_CATALOG',
+  'HAS_OPTIMIZER',
+  'HAS_WORKLOAD_ANALYTICS',
+  'HUE_I18n',
+  'HUE_VERSION',
+  'IS_K8S_ONLY',
+  'IS_NEW_INDEXER_ENABLED',
+  'IS_S3_ENABLED',
+  'isIE11',
+  'KO_DATERANGEPICKER_LABELS',
+  'LOGGED_USERGROUPS',
+  'LOGGED_USERNAME',
+  'METASTORE_PARTITION_LIMIT',
+  'USER_HOME_DIR',
+  'WorkerGlobalScope',
 
   // other misc
-  'ace', 'CodeMirror', 'impalaDagre', 'less', 'MediumEditor', 'moment', 'Role', 'trackOnGA', '__webpack_public_path__',
+  'ace',
+  'CodeMirror',
+  'impalaDagre',
+  'less',
+  'MediumEditor',
+  'moment',
+  'Role',
+  'trackOnGA',
+  '__webpack_public_path__',
 
   // jest
-  'afterAll', 'afterEach', 'beforeAll', 'beforeEach', 'describe', 'expect', 'fail', 'fdescribe', 'fit', 'it', 'jest',
-  'spyOn', 'xdescribe', 'xit'
+  'afterAll',
+  'afterEach',
+  'beforeAll',
+  'beforeEach',
+  'describe',
+  'expect',
+  'fail',
+  'fdescribe',
+  'fit',
+  'it',
+  'jest',
+  'spyOn',
+  'xdescribe',
+  'xit'
 ];
 
 const globals = normalGlobals.concat(hueGlobals).reduce((acc, key) => {
@@ -22,7 +58,6 @@ const globals = normalGlobals.concat(hueGlobals).reduce((acc, key) => {
   return acc;
 }, {});
 
-
 module.exports = {
   env: {
     browser: true,
@@ -30,20 +65,15 @@ module.exports = {
     es6: true,
     jasmine: true
   },
-  extends: [
-    'plugin:prettier/recommended'
-  ],
+  extends: ['plugin:prettier/recommended'],
   globals: globals,
   parser: 'babel-eslint',
   parserOptions: {
     ecmaVersion: 2017,
     sourceType: 'module',
-    ecmaFeatures: {
-    }
+    ecmaFeatures: {}
   },
-  plugins: [
-    'jest'
-  ],
+  plugins: ['jest'],
   rules: {
     'jest/no-focused-tests': 'error',
     'jest/valid-expect': 'error',
@@ -52,8 +82,9 @@ module.exports = {
     'no-restricted-syntax': [
       'error',
       {
-        'selector': 'CallExpression[callee.object.name="console"][callee.property.name!=/^(warn|error|info|trace)$/]',
-        'message': 'Unexpected property on console object was called'
+        selector:
+          'CallExpression[callee.object.name="console"][callee.property.name!=/^(warn|error|info|trace)$/]',
+        message: 'Unexpected property on console object was called'
       }
     ],
     'no-extra-boolean-cast': 0,
@@ -80,6 +111,5 @@ module.exports = {
     'valid-jsdoc': 0,
     curly: [2, 'all']
   },
-  settings: {
-  }
+  settings: {}
 };

+ 3 - 1
.prettierrc

@@ -1,4 +1,6 @@
 {
   "printWidth": 100,
-  "singleQuote": true
+  "singleQuote": true,
+  "trailingComma": "none",
+  "arrowParens": "avoid"
 }

+ 1 - 1
jest.config.js

@@ -3,7 +3,7 @@ module.exports = {
   moduleDirectories: ['node_modules', 'desktop/core/src/desktop/js'],
   modulePaths: ['desktop/core/src/desktop/js'],
   testMatch: ['<rootDir>/desktop/core/src/desktop/js/**/*.test.(js|jsx|ts|tsx)'],
-  testEnvironment: 'jest-environment-jsdom-fourteen',
+  testEnvironment: 'jest-environment-jsdom-sixteen',
   testURL: 'https://www.gethue.com/hue',
   setupFilesAfterEnv: ['<rootDir>/desktop/core/src/desktop/js/jest/jest.init.js'],
   watchPathIgnorePatterns: ['<rootDir>/desktop/core/src/desktop/static'],

Разница между файлами не показана из-за своего большого размера
+ 502 - 560
package-lock.json


+ 13 - 13
package.json

@@ -68,35 +68,35 @@
     "@babel/plugin-syntax-dynamic-import": "7.8.3",
     "@babel/preset-env": "7.10.2",
     "@babel/preset-typescript": "7.10.1",
-    "@types/jest": "^24.0.23",
+    "@types/jest": "26.0.0",
     "babel-eslint": "10.1.0",
-    "babel-jest": "^25.0.0",
+    "babel-jest": "26.0.1",
     "babel-jscs": "3.0.0-beta1",
     "babel-loader": "8.1.0",
     "babel-plugin-module-resolver": "4.0.0",
     "clean-webpack-plugin": "1.0.1",
     "css-loader": "^3.4.2",
-    "eslint": "5.12.1",
-    "eslint-config-prettier": "4.0.0",
-    "eslint-plugin-jest": "^23.0.4",
-    "eslint-plugin-prettier": "3.0.1",
+    "eslint": "7.2.0",
+    "eslint-config-prettier": "6.11.0",
+    "eslint-plugin-jest": "23.13.2",
+    "eslint-plugin-prettier": "3.1.4",
     "expose-loader": "0.7.5",
     "grunt": "^1.1.0",
     "grunt-contrib-less": "2.0.0",
     "grunt-contrib-watch": "1.1.0",
-    "jest": "^25.0.0",
-    "jest-environment-jsdom-fourteen": "^0.1.0",
-    "jsdom": "13.2.0",
+    "jest": "26.0.1",
+    "jest-environment-jsdom-sixteen": "1.0.3",
+    "jsdom": "16.2.2",
     "less-loader": "^5.0.0",
-    "lesshint": "^6.3.7",
+    "lesshint": "6.3.7",
     "license-checker": "^25.0.1",
     "load-grunt-tasks": "4.0.0",
     "markdown": "0.5.0",
-    "prettier": "1.16.1",
+    "prettier": "2.0.5",
     "source-map-loader": "1.0.0",
     "style-loader": "^1.1.3",
-    "stylelint": "^12.0.0",
-    "stylelint-config-standard": "^19.0.0",
+    "stylelint": "13.6.0",
+    "stylelint-config-standard": "20.0.0",
     "ts-loader": "7.0.5",
     "typescript": "3.9.5",
     "vue-loader": "^15.9.1",

Некоторые файлы не были показаны из-за большого количества измененных файлов