|
|
@ -1,4 +1,8 @@ |
|
|
|
const eslintrc = { |
|
|
|
const commonGlobals = { |
|
|
|
gtag: true, |
|
|
|
}; |
|
|
|
|
|
|
|
module.exports = { |
|
|
|
extends: [ |
|
|
|
'airbnb', |
|
|
|
'prettier', |
|
|
@ -31,6 +35,30 @@ const eslintrc = { |
|
|
|
'@typescript-eslint/no-unused-expressions': 2, |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
files: ['*.md'], |
|
|
|
globals: { |
|
|
|
...commonGlobals, |
|
|
|
React: true, |
|
|
|
ReactDOM: true, |
|
|
|
mountNode: true, |
|
|
|
}, |
|
|
|
rules: { |
|
|
|
indent: 0, |
|
|
|
'no-console': 0, |
|
|
|
'no-plusplus': 0, |
|
|
|
'eol-last': 0, |
|
|
|
'no-script-url': 0, |
|
|
|
'prefer-rest-params': 0, |
|
|
|
'react/no-access-state-in-setstate': 0, |
|
|
|
'react/destructuring-assignment': 0, |
|
|
|
'react/no-multi-comp': 0, |
|
|
|
'jsx-a11y/href-no-hash': 0, |
|
|
|
'import/no-extraneous-dependencies': 0, |
|
|
|
'import/no-unresolved': 0, |
|
|
|
'jsx-a11y/control-has-associated-label': 0, |
|
|
|
}, |
|
|
|
}, |
|
|
|
], |
|
|
|
rules: { |
|
|
|
camelcase: 0, |
|
|
@ -91,38 +119,10 @@ const eslintrc = { |
|
|
|
'jest/no-test-callback': 0, |
|
|
|
'jest/expect-expect': 0, |
|
|
|
'react-hooks/rules-of-hooks': 2, // Checks rules of Hooks
|
|
|
|
"unicorn/better-regex": 2, |
|
|
|
"unicorn/prefer-trim-start-end": 2, |
|
|
|
"unicorn/expiring-todo-comments": 2, |
|
|
|
"unicorn/no-abusive-eslint-disable": 2, |
|
|
|
}, |
|
|
|
globals: { |
|
|
|
gtag: true, |
|
|
|
'unicorn/better-regex': 2, |
|
|
|
'unicorn/prefer-trim-start-end': 2, |
|
|
|
'unicorn/expiring-todo-comments': 2, |
|
|
|
'unicorn/no-abusive-eslint-disable': 2, |
|
|
|
}, |
|
|
|
globals: commonGlobals, |
|
|
|
}; |
|
|
|
|
|
|
|
if (process.env.RUN_ENV === 'DEMO') { |
|
|
|
eslintrc.globals = Object.assign(eslintrc.globals, { |
|
|
|
React: true, |
|
|
|
ReactDOM: true, |
|
|
|
mountNode: true, |
|
|
|
}); |
|
|
|
|
|
|
|
Object.assign(eslintrc.rules, { |
|
|
|
indent: 0, |
|
|
|
'no-console': 0, |
|
|
|
'no-plusplus': 0, |
|
|
|
'eol-last': 0, |
|
|
|
'no-script-url': 0, |
|
|
|
'prefer-rest-params': 0, |
|
|
|
'react/no-access-state-in-setstate': 0, |
|
|
|
'react/destructuring-assignment': 0, |
|
|
|
'react/no-multi-comp': 0, |
|
|
|
'jsx-a11y/href-no-hash': 0, |
|
|
|
'import/no-extraneous-dependencies': 0, |
|
|
|
'import/no-unresolved': 0, |
|
|
|
'jsx-a11y/control-has-associated-label': 0, |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
module.exports = eslintrc; |
|
|
|