Skip to content

Commit

Permalink
Disable the rest of the new rules that are causing failures
Browse files Browse the repository at this point in the history
  • Loading branch information
TheRealJon committed Dec 12, 2019
1 parent 0aedc1f commit a5d7c0c
Show file tree
Hide file tree
Showing 7 changed files with 67 additions and 16 deletions.
8 changes: 3 additions & 5 deletions frontend/integration-tests/.eslintrc
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
{
"env": {
"node": true,
"es6": true,
"es6": true
},
"extends": [
"../.eslintrc"
],
"extends": ["../.eslintrc"],
"globals": {},
"rules": {
"no-console": ["error", { allow: ["warn", "error", "log", "info"] }],
"no-console": ["error", { "allow": ["warn", "error", "log", "info"] }]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,7 @@ export const AllProjectsDetailList: React.FC<UseActiveNamespaceProps> = ({ activ
);
};

// TODO Figure out why this is triggering a 'rules-of-hooks' failure since useActiveNamespace is not
// a hook
// eslint-disable-next-line react-hooks/rules-of-hooks
export default useActiveNamespace(AllProjectsDetailList);
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,7 @@ export const ProjectDetailsPage: React.FC<UseActiveNamespaceProps> = ({
);
};

// TODO Figure out why this is triggering a 'rules-of-hooks' failure since useActiveNamespace is not
// a hook
// eslint-disable-next-line react-hooks/rules-of-hooks
export default useActiveNamespace(ProjectDetailsPage);
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,27 @@ module.exports = {
},
],

// Disallow use of Object.prototypes builtins directly
'no-prototype-builtins': 'off',
/* ------------------------ New Rules as of eslint-config-airbnb-base v14.0.0 -------------------------
TODO The following rules are disabled since they are new and cause failures. Need follow up.
------------------------------------------------------------------------------------------------*/

// Ensure consistent use of file extension within the import path
'import/extensions': 'off',

// enforce a maximum number of classes per file
'max-classes-per-file': 'off',

// Disallow use of Object.prototypes builtins directly
'no-prototype-builtins': 'off',

// disallow unnecessary `catch` clauses
'no-useless-catch': 'off',

// Disallow using Object.assign with an object literal as the first argument and prefer the use of object spread instead.
'prefer-object-spread': 'off',

// Disallow assignments that can lead to race conditions due to usage of `await` or `yield`
'require-atomic-updates': 'off',
};
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,13 @@ module.exports = {

// Enforces the use of catch() on un-returned promises.
'promise/catch-or-return': 'error',

// TODO This rule was not working as expected prior to eslint-plugin-promise v4.2.1
// Disabling for now since it is causing failures after the update.
// Avoid wrapping values in Promise.resolve or Promise.reject when not needed.
'promise/no-return-wrap': 'error',
// 'promise/no-return-wrap': 'error',
'promise/no-return-wrap': 'off',

// Enforce consistent param names and ordering when creating new promises.
'promise/param-names': 'off',
// Return inside each then() to create readable and reusable Promise chains.
Expand Down
18 changes: 18 additions & 0 deletions frontend/packages/eslint-plugin-console/lib/config/rules/react.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,22 @@ module.exports = {

// Enforce that a label tag has a text label and an associated control.
'jsx-a11y/label-has-associated-control': ['error', { assert: 'either' }],

/* ------------------------ New Rules as of eslint-plugin-react v7.17.0 --------------------------
TODO The following rules are disabled since they are new and cause failures. Need follow up.
------------------------------------------------------------------------------------------------*/

// Enforces where React component static properties should be positioned.
'react/static-property-placement': 'off',

// Enforce the state initialization style to be either in a constructor or with a class property
'react/state-in-constructor': 'off',

// Enforce curly braces or disallow unnecessary curly braces in JSX
'react/jsx-curly-brace-presence': 'off',

// Enforce component methods order (fixable)
'react/sort-comp': 'off',
};
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,17 @@ module.exports = {
// },
// ],

// TODO This rule wasn't working as expected prior to @typescript-eslint/eslint-plugin v2.11.0.
// Disabled for now as it is causing failures
// Enforces the use of as Type assertions instead of <Type> assertions
'@typescript-eslint/consistent-type-assertions': [
'error',
{
assertionStyle: 'as',
objectLiteralTypeAssertions: 'allow-as-parameter',
},
],
// '@typescript-eslint/consistent-type-assertions': [
// 'error',
// {
// assertionStyle: 'as',
// objectLiteralTypeAssertions: 'allow-as-parameter',
// },
// ],
'@typescript-eslint/consistent-type-assertions': 'off',

// Disallow generic Array constructors
'no-array-constructor': 'off',
Expand All @@ -103,8 +106,11 @@ module.exports = {
// Disallow iterating over an array with a for-in loop
'@typescript-eslint/no-for-in-array': 'error',

// TODO This rule wasn't working as expected prior to @typescript-eslint/eslint-plugin v2.11.0.
// Disabled for now as it is causing failures
// Disallows explicit type declarations for variables or parameters initialized to a number, string, or boolean
'@typescript-eslint/no-inferrable-types': 'error',
// '@typescript-eslint/no-inferrable-types': 'error',
'@typescript-eslint/no-inferrable-types': 'off',

// Disallows magic numbers
'no-magic-numbers': 'off',
Expand Down

0 comments on commit a5d7c0c

Please sign in to comment.