Skip to content

Commit

Permalink
ENH Loosen rules
Browse files Browse the repository at this point in the history
  • Loading branch information
emteknetnz committed Jan 10, 2023
1 parent d7e7529 commit 77e01df
Showing 1 changed file with 163 additions and 8 deletions.
171 changes: 163 additions & 8 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,101 @@ const todo = {
// can use refs instead
'off',
],
'react/default-props-match-prop-types': [
'off'
],
'react/no-access-state-in-setstate': [
'off'
],
'default-param-last': [
'off'
],
'max-classes-per-file': [
'off'
],
'no-param-reassign': [
'off'
],
'no-unused-vars': [
'off',
{
'vars': 'local',
'ignoreRestSiblings': true
}
],
'implicit-arrow-linebreak': [
'off'
],
'no-param-reassign': [
'off'
],
'no-redeclare': [
'off'
],
'no-restricted-globals': [
'off'
],
'no-dupe-keys': [
'off'
],
// the following can be automatically fixed via the --fix option
'import/order': [
'off'
],
'function-paren-newline': [
'off'
],
'object-curly-newline': [
'off'
],
'no-multiple-empty-lines': [
'off'
],
'prefer-object-spread': [
'off'
],
'operator-linebreak': [
'off'
],
'no-else-return': [
'off'
],
'function-call-argument-newline': [
'off'
],
'no-unneeded-ternary': [
'off'
],
'semi-style': [
'off'
],
'lines-between-class-members': [
'off'
],
'react/jsx-curly-newline': [
'off'
],
'react/jsx-wrap-multilines': [
'off'
],
'react/jsx-tag-spacing': [
'off'
],
'react/jsx-one-expression-per-line': [
'off'
],
'react/jsx-fragments': [
'off'
],
'react/jsx-curly-brace-presence': [
'off'
],
'react/jsx-closing-tag-location': [
'off'
],
'react/forbid-foreign-prop-types': [
'off'
]
};

module.exports = {
Expand All @@ -41,11 +136,20 @@ module.exports = {
'rules': Object.assign({},
todo,
{
"max-len": [
"error",
{
"code": 200,
}
],
// turned off otherwise non-admin modules will complain about importing components from admin
// via the novel silverstripe js component sharing setup
'import/no-extraneous-dependencies': [
'off'
],
'import/no-unresolved': [
'off'
],
// turned off because the PHP side returns dangling properties which trigger this...
// could revise later and add exceptions for PHP data
'no-underscore-dangle': [
Expand All @@ -57,13 +161,6 @@ module.exports = {
'allowAfterThis': true
}
],
'no-unused-vars': [
'error',
{
'vars': 'local',
'ignoreRestSiblings': true
}
],
// increased to error because it's strongly discouraged
'react/no-danger': [
'error'
Expand All @@ -83,7 +180,7 @@ module.exports = {
'off'
],
'react/prefer-stateless-function': [
'error',
'off',
{ 'ignorePureComponents': true }
],
'import/prefer-default-export': [
Expand All @@ -110,9 +207,67 @@ module.exports = {
'jsx-a11y/anchor-has-content': [
'off'
],
'jsx-a11y/control-has-associated-label': [
'off'
],
'jsx-a11y/click-events-have-key-events': [
'off'
],
'jsx-a11y/no-static-element-interactions': [
'off'
],
'jsx-a11y/anchor-is-valid': [
'off'
],
'no-prototype-builtins': [
'off'
],
'prefer-destructuring': [
'off'
],
'prefer-promise-reject-errors': [
'off'
],
'no-promise-executor-return': [
'off'
],
'func-names': [
'off'
],
'react/destructuring-assignment': [
'off'
],
'react/jsx-props-no-spreading': [
'off'
],
'react/button-has-type': [
'off'
],
'react/no-array-index-key': [
'off'
],
'react/jsx-indent': [
'off'
],
'react/sort-comp': [
'off'
],
'react/no-unused-prop-types': [
'off'
],
'react/no-unused-class-component-methods': [
'off'
],
'react/function-component-definition': [
'off'
],
// raise warnings because it may cause weird bugs
'react/jsx-no-constructed-context-values': [
'warn'
],
'react/no-unstable-nested-components': [
'warn'
],
}),
'overrides': [
{
Expand Down

0 comments on commit 77e01df

Please sign in to comment.