Skip to content

Commit

Permalink
chore(805): legacy lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnTParsons authored and JohnTParsons committed Apr 26, 2023
1 parent 8f49073 commit 54e37f5
Show file tree
Hide file tree
Showing 19 changed files with 339 additions and 163 deletions.
94 changes: 94 additions & 0 deletions .eslintrc.base.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
{
"root": true,
"ignorePatterns": ["**/*"],
"plugins": ["@nrwl/nx"],
"settings": {
"next": {
"rootDir": "site/"
}
},
"env": {
"jest": true
},
"globals": {
"page": true,
"browser": true,
"context": true,
"cy": true,
"Cypress": true,
"window": true
},
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"rules": {
"@nrwl/nx/enforce-module-boundaries": "off",
"eslint-comments/no-unused-disable": "off"
}
},
{
"files": ["*.tsx"],
"extends": ["plugin:@next/next/recommended"],
"rules": {
"react/prop-types": "off",
"react/forbid-prop-types": "error",
"react-hooks/exhaustive-deps": "warn",
"react/jsx-props-no-spreading": "off",
"react/require-default-props": "off",

"react/jsx-no-useless-fragment": "off",
"react-hooks/rules-of-hooks": "warn",
"react/display-name": "off",
"react/jsx-key": "off"
}
},
{
"files": ["*.ts", "*.tsx"],
"extends": ["plugin:@nrwl/nx/typescript", "plugin:prettier/recommended", "prettier"],
"rules": {
"no-undef": "off",
"no-var": "off",
"no-console": "warn",
"func-names": "warn",

"@typescript-eslint/ban-types": "off",
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/no-this-alias": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-empty-interface": "off",
"@typescript-eslint/no-unused-expressions": "warn",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-inferrable-types": "off",
"@typescript-eslint/no-var-require": "off",
"@typescript-eslint/no-var-requires": "off",

"prettier/prettier": [
"error",
{
"singleQuote": true,
"trailingComma": "all",
"bracketSpacing": false,
"arrowParens": "avoid"
}
]
}
},
{
"files": ["*.js", "*.jsx"],
"extends": ["plugin:@nrwl/nx/javascript"],
"rules": {
"no-undef": "off"
}
},
{
"files": ["*.spec.ts", "*.spec.tsx", "*.test.js", "*.test.jsx"],
"env": {
"jest": true
},
"rules": {
"no-var": "off"
}
}
]
}
131 changes: 0 additions & 131 deletions .eslintrc.js

This file was deleted.

23 changes: 23 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"extends": [
"plugin:@nrwl/nx/react-typescript",
"plugin:@nrwl/nx/react",
"plugin:storybook/recommended",
"./.eslintrc.base.json"
],
"ignorePatterns": ["!**/*"],
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"rules": {}
},
{
"files": ["*.ts", "*.tsx"],
"rules": {}
},
{
"files": ["*.js", "*.jsx"],
"rules": {}
}
]
}
4 changes: 1 addition & 3 deletions .storybook/addons/tealium/register.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,7 @@ const Tool = () => {
});

return (
<>
<NewsKitProvider theme={newskitLightTheme}>
<NewsKitProvider theme={newskitLightTheme}>
<ConsentSettingsLink
privacyManagerId={CONFIG.privacyManagerId}
gdpr
Expand All @@ -87,7 +86,6 @@ const Tool = () => {
</span>
</Tooltip>
</NewsKitProvider>
</>
);
};

Expand Down
1 change: 0 additions & 1 deletion .storybook/manager.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from "react";
import {addons} from '@storybook/addons';
import storybookTheme from './storybook-theme';

Expand Down
1 change: 1 addition & 0 deletions .storybook/preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ export const parameters = {
docs: {
// We create a custom Docs page, using of our components for the header
page: () => {
// eslint-disable-next-line react-hooks/rules-of-hooks
const docsContext = React.useContext(DocsContext);
return (
<ThemeProvider theme={newskitLightTheme}>
Expand Down
2 changes: 1 addition & 1 deletion docs/scripts.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Scripts should be named using the following naming convention:

* `test:unit:comps` -> runs the unit tests on the src folder.

* `test:unit:site` -> runs the unit tests on the site folder.
* `test:unit:docs` -> runs the unit tests on the site folder.

* `test:visual:comps:ci:percy` -> starts the local storybook and runs the percy storybook tests afterwards.

Expand Down
6 changes: 3 additions & 3 deletions nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@
"runner": "nx/tasks-runners/default",
"options": {
"cacheableOperations": [
"lint:code:base",
"lint:code:comps",
"lint:code:docs",
"lint:code",
"lint:markdown",
"lint:next",
"test:unit:run:local",
"test:unit:run",
"test:unit:dev",
"test:unit:ci",
"test:unit:comps",
"test:unit:site"
"test:unit:docs"
]
}
}
Expand Down
Loading

0 comments on commit 54e37f5

Please sign in to comment.