Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deps: Update eslint to 9.3.0 #578

Merged
merged 32 commits into from
May 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
3a6fbee
deps: Install eslint 9
emil-litwiniec May 22, 2024
2cae999
deps: Rewrite eslint config in webapp-core
emil-litwiniec May 22, 2024
ba93d01
deps: Config rewrite webapp-crud-demo
emil-litwiniec May 23, 2024
3e7c39f
deps: Config rewrite webapp-contentful
emil-litwiniec May 23, 2024
a268d08
deps: Config rewrite webapp-api-client
emil-litwiniec May 23, 2024
c74e365
deps: Config rewrite webapp-documents
emil-litwiniec May 23, 2024
7a2f581
deps: Config rewrite webapp-emails
emil-litwiniec May 23, 2024
3520d95
deps: Config rewrite webapp-finances
emil-litwiniec May 23, 2024
41add45
deps: Config rewrite webapp-generative-ai
emil-litwiniec May 23, 2024
3a45789
deps: Config rewrite webapp-notifications
emil-litwiniec May 23, 2024
93645dd
deps: Config rewrite webapp-tenants
emil-litwiniec May 23, 2024
7ac279b
deps: Config rewrite webapp
emil-litwiniec May 23, 2024
f79b48f
deps: Config rewrite internal/cli
emil-litwiniec May 23, 2024
8bd3ed7
deps: Config rewrite status-dasboard
emil-litwiniec May 23, 2024
c71cb67
deps: Config rewrite docs
emil-litwiniec May 23, 2024
99bd4bd
deps: Config rewrite tools
emil-litwiniec May 23, 2024
b987eb6
deps: Config rewrite infra-core
emil-litwiniec May 23, 2024
c33c596
deps: Config rewrite infra-functions
emil-litwiniec May 23, 2024
1f2fdb1
deps: Config rewrite infra-shared
emil-litwiniec May 23, 2024
eb3ac22
deps: Config rewrite backend
emil-litwiniec May 24, 2024
b3978ff
chore: Use commonjs for eslint config files
emil-litwiniec May 24, 2024
eac478e
chore: Update generate template files
emil-litwiniec May 24, 2024
65a88ad
fix: webapp eslint config redundant root import
emil-litwiniec May 24, 2024
ddaf840
fix: Missing hook deps from rule testing
emil-litwiniec May 24, 2024
52e7d7a
fix: webapp-emails config error
emil-litwiniec May 24, 2024
1132f59
deps: Config rewrite workers
emil-litwiniec May 27, 2024
b583a06
chore: Remove unused recc glob chars
emil-litwiniec May 27, 2024
139b6bc
fix: workers lint bash script not seeing project root
emil-litwiniec May 27, 2024
714ca7f
chore: Remove redundant empty rules config objects
emil-litwiniec May 27, 2024
d1d84b3
deps: Update eslint plugins
emil-litwiniec May 27, 2024
a3f8672
fix: react types divereged versions
emil-litwiniec May 27, 2024
ce2edba
chore: Remove empty rules objects
emil-litwiniec May 27, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .eslintignore

This file was deleted.

81 changes: 0 additions & 81 deletions .eslintrc.json

This file was deleted.

92 changes: 92 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
const { FlatCompat } = require('@eslint/eslintrc');
const nxEslintPlugin = require('@nx/eslint-plugin');
const js = require('@eslint/js');

const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
});

module.exports = [
{ plugins: { '@nx': nxEslintPlugin } },
{
settings: {
'import/parsers': { '@typescript-eslint/parser': ['.ts', '.tsx'] },
'import/resolver': {
typescript: {
alwaysTryTypes: true,
project: 'tsconfig.base.json',
},
},
},
},
{
files: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx'],
rules: {
'@nx/enforce-module-boundaries': [
'error',
{
enforceBuildableLibDependency: true,
allow: [
'@sb/webapp-core/**',
'@sb/webapp-api-client/**',
'@sb/webapp-contentful/**',
'@sb/webapp-crud-demo/**',
'@sb/webapp-documents/**',
'@sb/webapp-finances/**',
'@sb/webapp-generative-ai/**',
'@sb/webapp-notifications/**',
'@sb/webapp-tenants/**',
],
depConstraints: [
{
sourceTag: '*',
onlyDependOnLibsWithTags: ['*'],
},
],
},
],
},
},
...compat
.config({
extends: [
'plugin:@nx/typescript',
'prettier',
'plugin:@typescript-eslint/recommended',
'plugin:import/errors',
'plugin:import/warnings',
'plugin:import/typescript',
],
})
.map((config) => ({
...config,
files: ['**/*.ts', '**/*.tsx'],
rules: {},
})),
...compat
.config({
extends: [
'plugin:@nx/javascript',
'prettier',
'plugin:import/errors',
'plugin:import/warnings',
'plugin:import/typescript',
],
})
.map((config) => ({
...config,
files: ['**/*.js', '**/*.jsx'],
rules: {},
})),
...compat.config({ env: { jest: true } }).map((config) => ({
...config,
files: ['**/*.spec.ts', '**/*.spec.tsx', '**/*.spec.js', '**/*.spec.jsx'],
rules: {},
})),
...compat.config({ parser: 'jsonc-eslint-parser' }).map((config) => ({
...config,
files: ['**/*.json'],
rules: {},
})),
];
15 changes: 12 additions & 3 deletions nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@
"cache": true
},
"lint": {
"inputs": ["default", "{workspaceRoot}/.eslintrc.json"],
"inputs": [
"default",
"{workspaceRoot}/.eslintrc.json",
"{workspaceRoot}/eslint.config.js"
],
"cache": true
},
"test": {
Expand All @@ -28,7 +32,11 @@
"cache": true
},
"@nx/eslint:lint": {
"inputs": ["default", "{workspaceRoot}/.eslintrc.json"],
"inputs": [
"default",
"{workspaceRoot}/.eslintrc.json",
"{workspaceRoot}/eslint.config.js"
],
"cache": true
}
},
Expand All @@ -44,7 +52,8 @@
"!{projectRoot}/.eslintrc.json",
"!{projectRoot}/**/?(*.)+(spec|test).[jt]s?(x)?(.snap)",
"!{projectRoot}/tsconfig.spec.json",
"!{projectRoot}/jest.config.[jt]s"
"!{projectRoot}/jest.config.[jt]s",
"!{projectRoot}/eslint.config.js"
],
"sharedGlobals": ["{workspaceRoot}/babel.config.json"]
},
Expand Down
24 changes: 13 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
"@apollo/client": "^3.9.6",
"@apollo/rover": "^0.19.1",
"@babel/preset-react": "^7.24.1",
"@eslint/compat": "^1.0.1",
"@eslint/eslintrc": "^2.1.1",
"@graphql-codegen/cli": "^5.0.0",
"@graphql-typed-document-node/core": "^3.2.0",
"@nx/devkit": "19.0.1",
Expand Down Expand Up @@ -39,29 +41,29 @@
"@types/jest": "^29.5.12",
"@types/node": "20.12.12",
"@types/ramda": "^0.28.25",
"@types/react": "^18.3.1",
"@types/react": "^18.3.3",
Copy link
Contributor Author

@emil-litwiniec emil-litwiniec May 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is some weird dep that breaks the react types, which makes docs fail to build from time to time when new pnpm lock is being created. I need to investigate it and pin naughty package to a specific version.

"@types/react-dom": "^18.3.0",
"@types/react-router": "^5.1.20",
"@types/react-router-dom": "5.3.3",
"@types/react-test-renderer": "^18.3.0",
"@typescript-eslint/eslint-plugin": "7.8.0",
"@typescript-eslint/parser": "7.8.0",
"@typescript-eslint/scope-manager": "5.62.0",
"@typescript-eslint/eslint-plugin": "7.10.0",
"@typescript-eslint/parser": "7.10.0",
"@typescript-eslint/scope-manager": "7.10.0",
"@vitejs/plugin-react": "^4.2.1",
"aws-cdk": "^2.142.1",
"aws-cdk-lib": "^2.142.1",
"babel-jest": "29.7.0",
"constructs": "^10.3.0",
"esbuild": "0.21.3",
"eslint": "8.57.0",
"eslint-config-prettier": "9.0.0",
"eslint": "9.3.0",
"eslint-config-prettier": "9.1.0",
"eslint-import-resolver-typescript": "^3.6.1",
"eslint-plugin-formatjs": "^4.11.3",
"eslint-plugin-import": "2.28.1",
"eslint-plugin-formatjs": "^4.13.3",
"eslint-plugin-import": "2.29.1",
"eslint-plugin-jsx-a11y": "^6.8.0",
"eslint-plugin-react": "7.33.2",
"eslint-plugin-react-hooks": "4.6.0",
"eslint-plugin-testing-library": "^6.2.0",
"eslint-plugin-react": "7.34.1",
"eslint-plugin-react-hooks": "4.6.2",
"eslint-plugin-testing-library": "^6.2.2",
"graphql": "^16.8.1",
"husky": "^9.0.11",
"jest": "29.7.0",
Expand Down
24 changes: 0 additions & 24 deletions packages/backend/.eslintrc

This file was deleted.

14 changes: 14 additions & 0 deletions packages/backend/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
const rootConfig = require('../../eslint.config.js');

module.exports = [
...rootConfig,
{
ignores: [
'!**/*',
'node_modules/**/*',
'cdk.out/**/*',
'__pypackages__/**/*',
'apps/finances/static/djstripe/*',
],
},
];
23 changes: 0 additions & 23 deletions packages/infra/infra-core/.eslintrc.json

This file was deleted.

12 changes: 12 additions & 0 deletions packages/infra/infra-core/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const rootConfig = require('../../../eslint.config.js');

module.exports = [
...rootConfig,
{
ignores: [
'node_modules/**/*',
'cdk.out/**/*',
'src/lib/patterns/ecr-sync/**/*',
],
},
];
23 changes: 0 additions & 23 deletions packages/infra/infra-functions/.eslintrc.json

This file was deleted.

8 changes: 8 additions & 0 deletions packages/infra/infra-functions/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
const baseConfig = require('../../../eslint.config.js');

module.exports = [
...baseConfig,
{
ignores: ['node_modules/**/*', '.serverless/**/*', 'cdk.out/**/*'],
},
];
22 changes: 0 additions & 22 deletions packages/infra/infra-shared/.eslintrc.json

This file was deleted.

Loading
Loading