Skip to content

Commit

Permalink
chore: remove unused eslintrc (apache#17860)
Browse files Browse the repository at this point in the history
* chore: remove unused eslintrc

* remove unused lint

* add comments

* change comments
  • Loading branch information
zhaoyongjie authored and shcoderAlex committed Feb 7, 2022
1 parent 31fd053 commit 5d0914a
Show file tree
Hide file tree
Showing 11 changed files with 50 additions and 354 deletions.
72 changes: 11 additions & 61 deletions superset-frontend/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/

const packageConfig = require('./package');

const importCoreModules = [];
Expand All @@ -26,7 +25,7 @@ Object.entries(packageConfig.dependencies).forEach(([pkg]) => {
}
});

// ignore files when running ForkTsCheckerWebpackPlugin
// ignore files in production mode
let ignorePatterns = [];
if (process.env.NODE_ENV === 'production') {
ignorePatterns = [
Expand All @@ -52,12 +51,14 @@ module.exports = {
},
env: {
browser: true,
node: true,
},
settings: {
'import/resolver': {
webpack: {},
node: {
extensions: ['.js', '.jsx', '.ts', '.tsx', '.json'],
// resolve modules from `/superset_frontend/node_modules` and `/superset_frontend`
moduleDirectory: ['node_modules', '.'],
},
},
// Allow only core/src and core/test, avoid import modules from lib
Expand All @@ -69,24 +70,6 @@ module.exports = {
},
plugins: ['prettier', 'react', 'file-progress'],
overrides: [
{
files: ['cypress-base/**/*'],
rules: {
'import/no-unresolved': 0,
'global-require': 0,
},
},
{
files: ['webpack*.js'],
env: {
node: true,
},
settings: {
'import/resolver': {
node: {},
},
},
},
{
files: ['*.ts', '*.tsx'],
parser: '@typescript-eslint/parser',
Expand Down Expand Up @@ -136,24 +119,6 @@ module.exports = {
'no-nested-ternary': 0,
'no-prototype-builtins': 0,
'no-restricted-properties': 0,
'no-restricted-imports': [
'warn',
{
paths: [
{
name: 'antd',
message:
'Please import Ant components from the index of common/components',
},
{
name: '@superset-ui/core',
importNames: ['supersetTheme'],
message:
'Please use the theme directly from the ThemeProvider rather than importing supersetTheme.',
},
],
},
],
'no-shadow': 0, // re-enable up for discussion
'no-use-before-define': 0, // disabled temporarily
'padded-blocks': 0,
Expand All @@ -178,25 +143,13 @@ module.exports = {
},
settings: {
'import/resolver': {
webpack: {},
typescript: {},
},
react: {
version: 'detect',
},
},
},
{
files: ['*.stories.jsx', '*.stories.tsx'],
rules: {
// this is to keep eslint from complaining about storybook addons,
// since they are included as dev dependencies rather than direct dependencies.
'import/no-extraneous-dependencies': [
'error',
{ devDependencies: true },
],
},
},
{
files: [
'*.test.ts',
Expand Down Expand Up @@ -239,15 +192,6 @@ module.exports = {
'jest-dom/prefer-to-have-style': 0,
},
},
{
files: './packages/generator-superset/**/*.test.*',
env: {
node: true,
},
rules: {
'jest/expect-expect': 0,
},
},
],
rules: {
camelcase: [
Expand Down Expand Up @@ -287,14 +231,20 @@ module.exports = {
'no-prototype-builtins': 0,
'no-restricted-properties': 0,
'no-restricted-imports': [
'error',
'warn',
{
paths: [
{
name: 'antd',
message:
'Please import Ant components from the index of common/components',
},
{
name: '@superset-ui/core',
importNames: ['supersetTheme'],
message:
'Please use the theme directly from the ThemeProvider rather than importing supersetTheme.',
},
],
},
],
Expand Down
1 change: 1 addition & 0 deletions superset-frontend/.prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,4 @@ CHANGELOG.md
*.geojson
*-topo.json
temporary_superset_ui/
storybook-static/
1 change: 1 addition & 0 deletions superset-frontend/cypress-base/cypress/plugins/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
// the project's config changing)

module.exports = (on, config) => {
// eslint-disable-next-line global-require
require('@cypress/code-coverage/task')(on, config);
return config;
};
Loading

0 comments on commit 5d0914a

Please sign in to comment.