Skip to content

Commit

Permalink
Eslint dependencies versions updates (#10839)
Browse files Browse the repository at this point in the history
* Update eslint version to 7.8.1

* Give names to unnamed functions  to fix lint errors

* Update eslint-import-resolver-webpack

* Update eslint-plugin-cypress

* Add eslint-plugin-react-hooks

* Update necessary peer dependencies for eslint-config-airbnb

* Update eslint airbnb config and ts plugins

* Remove "this" from functional component

* Disable all rules that cause new errors

* Fix linting errors in tests

* Add licenses to .eslintrc files

* Add path and zlib to package.json

* Disable incompatible rule in eslint-plugin-cypress

* Remove redundant config for typescript linting

* Mark disabled rules with comments

* Remove path and zlib from deps, disable import rule for webpack files
  • Loading branch information
kgabryje committed Sep 14, 2020
1 parent 1f31e0e commit 8a774d5
Show file tree
Hide file tree
Showing 14 changed files with 1,620 additions and 518 deletions.
73 changes: 59 additions & 14 deletions superset-frontend/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/
module.exports = {
extends: ['airbnb', 'prettier'],
extends: ['airbnb', 'prettier', 'prettier/react'],
parser: 'babel-eslint',
parserOptions: {
ecmaFeatures: {
Expand All @@ -36,6 +36,12 @@ module.exports = {
'global-require': 0,
},
},
{
files: ['webpack*.js'],
rules: {
'import/no-extraneous-dependencies': 0,
},
},
{
files: ['*.ts', '*.tsx'],
parser: '@typescript-eslint/parser',
Expand All @@ -44,24 +50,25 @@ module.exports = {
'plugin:@typescript-eslint/recommended',
'prettier',
'prettier/@typescript-eslint',
'prettier/react',
],
plugins: ['@typescript-eslint/eslint-plugin', 'prettier', 'react'],
rules: {
'@typescript-eslint/ban-ts-ignore': 0,
'@typescript-eslint/camelcase': [
'error',
{
allow: ['^UNSAFE_'],
properties: 'never',
},
],
'@typescript-eslint/ban-ts-comment': 0, // disabled temporarily
'@typescript-eslint/ban-types': 0, // disabled temporarily
'@typescript-eslint/no-empty-function': 0,
'@typescript-eslint/no-explicit-any': 0,
'@typescript-eslint/no-non-null-assertion': 0, // disabled temporarily
'@typescript-eslint/no-use-before-define': 1, // disabled temporarily
'@typescript-eslint/no-unused-vars': 0, // disabled temporarily
'@typescript-eslint/explicit-function-return-type': 0,
'@typescript-eslint/explicit-module-boundary-types': 0, // re-enable up for discussion
camelcase: 0,
'class-methods-use-this': 0,
'func-names': 0,
'guard-for-in': 0,
'import/no-cycle': 0, // re-enable up for discussion, might require some major refactors
'import/extensions': [
'error',
{
Expand All @@ -72,19 +79,26 @@ module.exports = {
],
'import/no-named-as-default': 0,
'import/no-named-as-default-member': 0,
'import/no-useless-path-segments': 0, // disabled temporarily
'import/prefer-default-export': 0,
indent: 0,
'jsx-a11y/anchor-has-content': 0,
'jsx-a11y/href-no-hash': 0,
'jsx-a11y/anchor-is-valid': 0, // disabled temporarily
'jsx-a11y/click-events-have-key-events': 0, // re-enable up for discussion
'jsx-a11y/control-has-associated-label': 0, // disabled temporarily
'jsx-a11y/mouse-events-have-key-events': 0, // re-enable up for discussion
'lines-between-class-members': 0, // disabled temporarily
'new-cap': 0,
'no-bitwise': 0,
'no-confusing-arrow': 0,
'no-continue': 0,
'no-else-return': 0, // disabled temporarily
'no-mixed-operators': 0,
'no-multi-assign': 0,
'no-multi-spaces': 0,
'no-plusplus': 0,
'no-prototype-builtins': 0,
'no-restricted-globals': 0, // disabled temporarily
'no-restricted-properties': 0,
'no-restricted-syntax': 0,
'no-restricted-imports': [
Expand All @@ -99,18 +113,30 @@ module.exports = {
],
},
],
'no-shadow': 0, // re-enable up for discussion
'no-use-before-define': 0, // disabled temporarily
'padded-blocks': 0,
'prefer-arrow-callback': 0,
'prefer-destructuring': 0, // disabled temporarily
'react/default-props-match-prop-types': 0, // disabled temporarily
'react/destructuring-assignment': 0, // re-enable up for discussion
'react/forbid-prop-types': 0,
'react/jsx-curly-brace-presence': 0, // disabled temporarily
'react/jsx-filename-extension': [1, { extensions: ['.jsx', '.tsx'] }],
'react/jsx-fragments': 1,
'react/jsx-no-bind': 0,
'react/jsx-props-no-spreading': 0, // re-enable up for discussion
'react/no-access-state-in-setstate': 0, // disabled temporarily
'react/no-array-index-key': 0,
'react/no-string-refs': 0,
'react/no-unescaped-entities': 0,
'react/no-unused-prop-types': 0,
'react/require-default-props': 0,
'react/jsx-fragments': 1,
'react/no-unused-state': 0, // disabled temporarily
'react/prop-types': 0,
'react/require-default-props': 0,
'react/sort-comp': 0, // disabled temporarily
'react/state-in-constructor': 0, // disabled temporarily
'react/static-property-placement': 0, // re-enable up for discussion
'prettier/prettier': 'error',
},
settings: {
Expand Down Expand Up @@ -174,12 +200,20 @@ module.exports = {
'.json': 'always',
},
],
'import/no-cycle': 0, // re-enable up for discussion, might require some major refactors
'import/no-named-as-default': 0,
'import/no-useless-path-segments': 0, // disabled temporarily
'import/prefer-default-export': 0,
indent: 0,
'jsx-a11y/anchor-has-content': 0,
'jsx-a11y/href-no-hash': 0,
'jsx-a11y/anchor-is-valid': 0, // disabled temporarily
'jsx-a11y/click-events-have-key-events': 0, // re-enable up for discussion
'jsx-a11y/control-has-associated-label': 0, // disabled temporarily
'jsx-a11y/mouse-events-have-key-events': 0, // re-enable up for discussion
'lines-between-class-members': 0, // disabled temporarily
'new-cap': 0,
'no-restricted-globals': 0, // disabled temporarily
'no-else-return': 0, // disabled temporarily
'no-bitwise': 0,
'no-confusing-arrow': 0,
'no-continue': 0,
Expand All @@ -202,19 +236,30 @@ module.exports = {
],
},
],
'no-shadow': 0, // re-enable up for discussion
'padded-blocks': 0,
'prefer-arrow-callback': 0,
'prefer-object-spread': 1,
'prefer-destructuring': 0, // disabled temporarily
'react/default-props-match-prop-types': 0, // disabled temporarily
'react/destructuring-assignment': 0, // re-enable up for discussion
'react/forbid-prop-types': 0,
'react/jsx-curly-brace-presence': 0, // disabled temporarily
'react/jsx-filename-extension': [1, { extensions: ['.jsx', '.tsx'] }],
'react/jsx-fragments': 1,
'react/jsx-no-bind': 0,
'react/jsx-props-no-spreading': 0, // re-enable up for discussion
'react/no-access-state-in-setstate': 0, // disabled temporarily
'react/no-array-index-key': 0,
'react/no-string-refs': 0,
'react/no-unescaped-entities': 0,
'react/no-unused-prop-types': 0,
'react/require-default-props': 0,
'react/jsx-fragments': 1,
'react/no-unused-state': 0, // disabled temporarily
'react/prop-types': 0,
'react/require-default-props': 0,
'react/sort-comp': 0, // disabled temporarily
'react/state-in-constructor': 0, // disabled temporarily
'react/static-property-placement': 0, // disabled temporarily
'prettier/prettier': 'error',
},
settings: {
Expand Down
21 changes: 20 additions & 1 deletion superset-frontend/cypress-base/.eslintrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
{
"parser": "@typescript-eslint/parser",
"plugins": ["cypress", "@typescript-eslint"],
Expand All @@ -10,7 +28,8 @@
"@typescript-eslint/explicit-function-return-type": 0,
"@typescript-eslint/explicit-module-boundary-types": 0,
"@typescript-eslint/no-var-requires": 0,
"@typescript-eslint/camelcase": 0
"@typescript-eslint/camelcase": 0,
"cypress/no-unnecessary-waiting": 0 // see issue https://github.com/cypress-io/eslint-plugin-cypress/issues/69
},
"settings": {
"import/resolver": {
Expand Down
Loading

0 comments on commit 8a774d5

Please sign in to comment.