Skip to content

Commit

Permalink
deps: Update eslint to 9.3.0 (#578)
Browse files Browse the repository at this point in the history
  • Loading branch information
emil-litwiniec authored May 30, 2024
1 parent 4880940 commit b610ad3
Show file tree
Hide file tree
Showing 74 changed files with 2,267 additions and 2,532 deletions.
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",
"@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

0 comments on commit b610ad3

Please sign in to comment.