Skip to content

Commit 9dad882

Browse files
committed
chore: update deps and migrate ESLint config
1 parent 88c5420 commit 9dad882

38 files changed

+1649
-1490
lines changed

.eslintignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

.eslintrc.json

Lines changed: 0 additions & 107 deletions
This file was deleted.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,4 @@ testem.log
3939
Thumbs.db
4040

4141
.nx/cache
42+
.nx/workspace-data

.prettierignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@
33
/coverage
44
/.nx/cache
55
CHANGELOG.md
6+
7+
/.nx/workspace-data

eslint.config.js

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
const { FlatCompat } = require('@eslint/eslintrc');
2+
const js = require('@eslint/js');
3+
const nxEslintPlugin = require('@nx/eslint-plugin');
4+
5+
const compat = new FlatCompat({
6+
baseDirectory: __dirname,
7+
recommendedConfig: js.configs.recommended,
8+
});
9+
10+
module.exports = [
11+
{ plugins: { '@nx': nxEslintPlugin } },
12+
...compat
13+
.config({ plugins: ['unused-imports', 'simple-import-sort'] })
14+
.map((config) => ({
15+
...config,
16+
files: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx'],
17+
rules: {
18+
...config.rules,
19+
'@nx/enforce-module-boundaries': [
20+
'error',
21+
{
22+
enforceBuildableLibDependency: true,
23+
banTransitiveDependencies: true,
24+
allow: [],
25+
depConstraints: [
26+
{
27+
sourceTag: '*',
28+
onlyDependOnLibsWithTags: ['*'],
29+
},
30+
],
31+
},
32+
],
33+
'no-duplicate-imports': 'error',
34+
'no-empty': 'error',
35+
'no-fallthrough': 'error',
36+
'no-param-reassign': 'error',
37+
'no-unreachable': 'error',
38+
'no-unreachable-loop': 'error',
39+
'no-var': 'error',
40+
'prefer-const': 'error',
41+
'no-return-await': 'error',
42+
'require-await': 'error',
43+
'require-yield': 'error',
44+
'simple-import-sort/imports': [
45+
'error',
46+
{ groups: [['^\\u0000'], ['^@?\\w'], ['^'], ['^\\.']] },
47+
],
48+
'simple-import-sort/exports': 'error',
49+
},
50+
})),
51+
...compat.config({ extends: ['plugin:@nx/typescript'] }).map((config) => ({
52+
...config,
53+
files: ['**/*.ts', '**/*.tsx'],
54+
rules: {
55+
...config.rules,
56+
'@typescript-eslint/no-extra-semi': 'error',
57+
'no-extra-semi': 'off',
58+
},
59+
})),
60+
...compat.config({ extends: ['plugin:@nx/javascript'] }).map((config) => ({
61+
...config,
62+
files: ['**/*.js', '**/*.jsx'],
63+
rules: {
64+
...config.rules,
65+
'@typescript-eslint/no-extra-semi': 'error',
66+
'no-extra-semi': 'off',
67+
},
68+
})),
69+
...compat.config({ env: { jest: true } }).map((config) => ({
70+
...config,
71+
files: ['**/*.spec.ts', '**/*.spec.tsx', '**/*.spec.js', '**/*.spec.jsx'],
72+
rules: {
73+
...config.rules,
74+
},
75+
})),
76+
];

jest.config.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { getJestProjects } from '@nx/jest';
1+
import { getJestProjectsAsync } from '@nx/jest';
22

3-
export default {
4-
projects: getJestProjects(),
5-
};
3+
export default async () => ({
4+
projects: await getJestProjectsAsync(),
5+
});

migrations.json

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
{
2+
"migrations": [
3+
{
4+
"cli": "nx",
5+
"version": "19.2.0-beta.2",
6+
"description": "Updates the default workspace data directory to .nx/workspace-data",
7+
"implementation": "./src/migrations/update-19-2-0/move-workspace-data-directory",
8+
"package": "nx",
9+
"name": "19-2-0-move-graph-cache-directory"
10+
},
11+
{
12+
"cli": "nx",
13+
"version": "19.2.2-beta.0",
14+
"description": "Updates the nx wrapper.",
15+
"implementation": "./src/migrations/update-17-3-0/update-nxw",
16+
"package": "nx",
17+
"name": "19-2-2-update-nx-wrapper"
18+
},
19+
{
20+
"version": "19.2.4-beta.0",
21+
"description": "Set project name in nx.json explicitly",
22+
"implementation": "./src/migrations/update-19-2-4/set-project-name",
23+
"x-repair-skip": true,
24+
"package": "nx",
25+
"name": "19-2-4-set-project-name"
26+
},
27+
{
28+
"version": "20.0.0-beta.7",
29+
"description": "Migration for v20.0.0-beta.7",
30+
"implementation": "./src/migrations/update-20-0-0/move-use-daemon-process",
31+
"package": "nx",
32+
"name": "move-use-daemon-process"
33+
},
34+
{
35+
"cli": "nx",
36+
"version": "19.1.0-beta.6",
37+
"description": "Migrate no-extra-semi rules into user config, out of nx extendable configs",
38+
"implementation": "./src/migrations/update-19-1-0-migrate-no-extra-semi/migrate-no-extra-semi",
39+
"package": "@nx/eslint-plugin",
40+
"name": "update-19-1-0-rename-no-extra-semi"
41+
},
42+
{
43+
"cli": "nx",
44+
"version": "20.0.0-beta.5",
45+
"description": "replace getJestProjects with getJestProjectsAsync",
46+
"implementation": "./src/migrations/update-20-0-0/replace-getJestProjects-with-getJestProjectsAsync",
47+
"package": "@nx/jest",
48+
"name": "replace-getJestProjects-with-getJestProjectsAsync"
49+
}
50+
]
51+
}

nx.json

Lines changed: 34 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,37 @@
11
{
2-
"pluginsConfig": { "@nx/js": { "analyzeSourceFiles": true } },
2+
"pluginsConfig": {
3+
"@nx/js": {
4+
"analyzeSourceFiles": true
5+
}
6+
},
37
"extends": "nx/presets/npm.json",
48
"$schema": "./node_modules/nx/schemas/nx-schema.json",
59
"namedInputs": {
610
"production": [
711
"!{projectRoot}/test/**",
812
"!{projectRoot}/**/*.{spec,test}.ts",
9-
"!{projectRoot}/node_modules/**"
13+
"!{projectRoot}/node_modules/**",
14+
"!{projectRoot}/eslint.config.js"
1015
]
1116
},
1217
"release": {
1318
"projects": ["packages/*"],
1419
"projectsRelationship": "independent",
15-
"changelog": { "projectChangelogs": { "createRelease": "github" } },
20+
"changelog": {
21+
"projectChangelogs": {
22+
"createRelease": "github"
23+
}
24+
},
1625
"version": {
1726
"conventionalCommits": true,
18-
"generatorOptions": { "skipLockFileUpdate": true }
27+
"generatorOptions": {
28+
"skipLockFileUpdate": true
29+
}
1930
},
20-
"git": { "commit": true, "tag": true }
31+
"git": {
32+
"commit": true,
33+
"tag": true
34+
}
2135
},
2236
"targetDefaults": {
2337
"build": {
@@ -28,15 +42,27 @@
2842
"@nx/jest:jest": {
2943
"cache": true,
3044
"inputs": ["default", "^default", "{workspaceRoot}/jest.preset.js"],
31-
"options": { "passWithNoTests": true },
32-
"configurations": { "ci": { "ci": true, "codeCoverage": true } }
45+
"options": {
46+
"passWithNoTests": true
47+
},
48+
"configurations": {
49+
"ci": {
50+
"ci": true,
51+
"codeCoverage": true
52+
}
53+
}
3354
},
3455
"nx-release-publish": {
3556
"options": {
3657
"packageRoot": "dist/{projectRoot}",
3758
"registry": "https://registry.npmjs.org/"
3859
},
39-
"dependsOn": [{ "target": "build", "params": "forward" }]
60+
"dependsOn": [
61+
{
62+
"target": "build",
63+
"params": "forward"
64+
}
65+
]
4066
},
4167
"@nx/eslint:lint": {
4268
"cache": true,

0 commit comments

Comments
 (0)