From c260053fc26f4db6560736fe784b4c47229f1fe6 Mon Sep 17 00:00:00 2001 From: Aaron Abramov Date: Thu, 29 Jun 2017 10:31:03 -0700 Subject: [PATCH] lint .eslintrc.js (#3938) --- .eslintignore | 1 + .eslintrc.js | 79 +++++++++++++++++++++++++++------------------------ 2 files changed, 43 insertions(+), 37 deletions(-) diff --git a/.eslintignore b/.eslintignore index b2aca5e5fc57..4ff3425305cc 100644 --- a/.eslintignore +++ b/.eslintignore @@ -11,3 +11,4 @@ website/core/metadata*.js website/i18n/*.js website/src/jest/docs website/src/jest/blog +!.eslintrc.js diff --git a/.eslintrc.js b/.eslintrc.js index cce09f2050a7..afbda8cf0be7 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -9,66 +9,71 @@ module.exports = { extends: [ './packages/eslint-config-fb-strict/index.js', - 'plugin:import/errors' + 'plugin:import/errors', ], - parser: 'babel-eslint', - rules: { - 'computed-property-spacing': 0, - 'flowtype/boolean-style': 2, - 'flowtype/no-primitive-constructor-types': 2, - 'flowtype/require-valid-file-annotation': 2, - 'max-len': 0, - 'no-multiple-empty-lines': 1, - 'import/no-duplicates': 2, - 'import/no-unresolved': [2, {ignore: ['^types/']}], - // This has to be disabled until all type and module imports are combined - // https://github.com/benmosher/eslint-plugin-import/issues/645 - 'import/order': 0, - // These has to be disabled until the whole code base is converted to ESM - 'import/default': 0, - 'import/named': 0, - 'unicorn/filename-case': [2, {case: 'snakeCase'}] - }, - plugins: ['markdown', 'import', 'unicorn'], overrides: [ // to make it more suitable for running on code examples in docs/ folder { files: ['*.md'], rules: { - 'react/react-in-jsx-scope': 0, - 'react/jsx-no-undef': 0, + 'consistent-return': 0, + 'import/no-unresolved': 0, 'jest/no-focused-tests': 0, - 'jest/valid-expect': 0, 'jest/no-identical-title': 0, + 'jest/valid-expect': 0, 'no-undef': 0, 'no-unused-vars': 0, - 'consistent-return': 0, - 'import/no-unresolved': 0, + 'react/jsx-no-undef': 0, + 'react/react-in-jsx-scope': 0, 'sort-keys': 0, - 'unicorn/filename-case': 0 - } + 'unicorn/filename-case': 0, + }, }, { files: ['examples/**/*'], rules: { 'babel/func-params-comma-dangle': 0, - 'import/order': 0, 'import/no-unresolved': [2, {ignore: ['^react-native$']}], - 'unicorn/filename-case': 0 - } + 'import/order': 0, + 'unicorn/filename-case': 0, + }, }, { files: ['scripts/**/*', 'integration_tests/**/*'], rules: { 'babel/func-params-comma-dangle': 0, - 'unicorn/filename-case': 0 - } + 'unicorn/filename-case': 0, + }, }, { - files: ['**/__mocks__/**/*', 'website/**/*', '**/jest-runtime/**/*', '**/src/Console*'], + files: [ + '**/__mocks__/**/*', + 'website/**/*', + '**/jest-runtime/**/*', + '**/src/Console*', + ], rules: { - 'unicorn/filename-case': 0 - } - } - ] + 'unicorn/filename-case': 0, + }, + }, + ], + parser: 'babel-eslint', + plugins: ['markdown', 'import', 'unicorn'], + rules: { + 'computed-property-spacing': 0, + 'flowtype/boolean-style': 2, + 'flowtype/no-primitive-constructor-types': 2, + 'flowtype/require-valid-file-annotation': 2, + 'import/default': 0, + 'import/named': 0, + 'import/no-duplicates': 2, + 'import/no-unresolved': [2, {ignore: ['^types/']}], + // This has to be disabled until all type and module imports are combined + // https://github.com/benmosher/eslint-plugin-import/issues/645 + 'import/order': 0, + // These has to be disabled until the whole code base is converted to ESM + 'max-len': 0, + 'no-multiple-empty-lines': 1, + 'unicorn/filename-case': [2, {case: 'snakeCase'}], + }, };