Skip to content

Commit

Permalink
Tweaked eslint configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
patw0929 committed Dec 5, 2018
1 parent bdcabb5 commit 9d88836
Show file tree
Hide file tree
Showing 2 changed files with 87 additions and 79 deletions.
1 change: 0 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@ dist/*
example/*
test/*
node_modules/*
Gruntfile.js
package.json
webpack.*.js
165 changes: 87 additions & 78 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,104 +1,113 @@
module.exports = {
'extends': 'eslint-config-airbnb',
'parser': 'babel-eslint',
'env': {
'browser': true,
'node': true,
'es6': true,
'jest': true
extends: ['eslint-config-airbnb', 'prettier'],
parser: 'babel-eslint',
env: {
browser: true,
node: true,
es6: true,
jest: true,
},
'ecmaFeatures': {
'jsx': true
},
'rules': {
rules: {
'prefer-destructuring': 'off',
'jsx-a11y/click-events-have-key-events': 'off',
'jsx-a11y/no-noninteractive-element-interactions': 'off',
'jsx-a11y/no-autofocus': 'off',
'jsx-a11y/no-noninteractive-tabindex': 'off',
'jsx-a11y/anchor-has-content': 'off',
'react/destructuring-assignment': 'off',
'react/jsx-no-bind': 'error',
'react/no-multi-comp': 'off',
'no-restricted-syntax': [
'error',
'DebuggerStatement',
'ForInStatement',
'WithStatement'
'WithStatement',
],
'newline-after-var': ['error', 'always'],
'newline-before-return': 'error',
'comma-dangle': ['error', 'always-multiline'], // https://github.com/airbnb/javascript/commit/788208295469e19b806c06e01095dc8ba1b6cdc9
'indent': ['error', 2, {'SwitchCase': 1}],
indent: ['error', 2, { SwitchCase: 1 }],
'no-console': 0,
'no-alert': 0,
'no-underscore-dangle': 'off',
'max-len': [ 'error', 150, 2, { 'ignoreUrls': true, 'ignoreComments': false, } ],
'max-len': ['error', 150, 2, { ignoreUrls: true, ignoreComments: false }],
'react/require-default-props': 'off',
'react/jsx-curly-spacing': [ 'error', 'always', { 'allowMultiline': true } ],
'react/jsx-curly-spacing': 'off',
'arrow-body-style': 'off',
'no-mixed-operators': ['error', {
'groups': [
['&', '|', '^', '~', '<<', '>>', '>>>'],
['==', '!=', '===', '!==', '>', '>=', '<', '<='],
['&&', '||'],
['in', 'instanceof']
],
'allowSamePrecedence': true
} ],
'react/jsx-filename-extension': ['error', { 'extensions': ['.js', '.jsx'] }],
'no-mixed-operators': [
'error',
{
groups: [
['&', '|', '^', '~', '<<', '>>', '>>>'],
['==', '!=', '===', '!==', '>', '>=', '<', '<='],
['&&', '||'],
['in', 'instanceof'],
],
allowSamePrecedence: true,
},
],
'react/jsx-filename-extension': ['error', { extensions: ['.js', '.jsx'] }],
'react/no-string-refs': 'off',
'arrow-parens': ['error', 'always'],
'arrow-parens': 'off',
'jsx-a11y/no-static-element-interactions': 'off',
'react/prefer-stateless-function': 'off',
'no-param-reassign': 'off',
'no-unused-vars': ['error', { 'ignoreRestSiblings': true }],
'import/no-unresolved': [2, { ignore: ['react', 'react-dom', 'react-intl-tel-input'] }],
'no-unused-vars': ['error', { ignoreRestSiblings: true }],
'import/no-unresolved': [
2,
{ ignore: ['react', 'react-dom', 'react-intl-tel-input'] },
],
'import/extensions': 'off',
'import/no-extraneous-dependencies': ['error', {
devDependencies: [
'test/**', // tape, common npm pattern
'tests/**', // also common npm pattern
'spec/**', // mocha, rspec-like pattern
'**/__tests__/**', // jest pattern
'**/__mocks__/**', // jest pattern
'test.js', // repos with a single test file
'test-*.js', // repos with multiple top-level test files
'**/*.test.js', // tests where the extension denotes that it is a test
'**/webpack.config.js', // webpack config
'**/webpack.config.*.js', // webpack config
'**/rollup.config.js', // rollup config
'**/gulpfile.js', // gulp config
'**/gulpfile.*.js', // gulp config
'**/Gruntfile', // grunt config
'config/jest/**',
'src/testUtils/**',
'*.js'
],
optionalDependencies: false,
}],
indent: ['error', 2, {
SwitchCase: 1,
VariableDeclarator: 1,
outerIIFEBody: 1,
MemberExpression: 1,
// CallExpression: {
'import/no-extraneous-dependencies': [
'error',
{
devDependencies: [
'test/**', // tape, common npm pattern
'tests/**', // also common npm pattern
'spec/**', // mocha, rspec-like pattern
'**/__tests__/**', // jest pattern
'**/__mocks__/**', // jest pattern
'test.js', // repos with a single test file
'test-*.js', // repos with multiple top-level test files
'**/*.test.js', // tests where the extension denotes that it is a test
'**/webpack.config.js', // webpack config
'**/webpack.config.*.js', // webpack config
'config/jest/**',
'src/testUtils/**',
'*.js',
],
optionalDependencies: false,
},
],
indent: [
'error',
2,
{
SwitchCase: 1,
VariableDeclarator: 1,
outerIIFEBody: 1,
MemberExpression: 1,
// CallExpression: {
// parameters: null,
// },
FunctionDeclaration: {
parameters: 1,
body: 1
// },
FunctionDeclaration: {
parameters: 1,
body: 1,
},
FunctionExpression: {
parameters: 1,
body: 1,
},
},
FunctionExpression: {
parameters: 1,
body: 1
}
}],
'no-plusplus': ['error', { "allowForLoopAfterthoughts": true }]
],
'no-plusplus': ['error', { allowForLoopAfterthoughts: true }],
},
plugins: ['react', 'import', 'security'],
globals: {
__DEVELOPMENT__: true,
__CLIENT__: true,
__SERVER__: true,
__DISABLE_SSR__: true,
__DEVTOOLS__: true,
},
'plugins': [
'react',
'import',
'security'
],
'globals': {
'__DEVELOPMENT__': true,
'__CLIENT__': true,
'__SERVER__': true,
'__DISABLE_SSR__': true,
'__DEVTOOLS__': true,
}
};

0 comments on commit 9d88836

Please sign in to comment.