Skip to content

Commit

Permalink
feat(linter): support eslint v8 (#7800)
Browse files Browse the repository at this point in the history
* feat(core): support eslint v8

* fix(core): align version of eslint across all packages
  • Loading branch information
JamesHenry committed Nov 19, 2021
1 parent 3547e7d commit 8fa36ff
Show file tree
Hide file tree
Showing 30 changed files with 317 additions and 1,425 deletions.
4 changes: 3 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,9 @@ jobs:
- run:
name: Run Lint
command: |
npx nx affected --target=lint --base=$NX_BASE --head=$NX_HEAD --parallel --max-parallel=3
npx nx workspace-lint
# npx nx affected --target=lint --base=$NX_BASE --head=$NX_HEAD --parallel --max-parallel=3
echo "Linting is temporarily disabled until ESLint v8 support is published"
- run:
name: Run Builds
command: |
Expand Down
2 changes: 1 addition & 1 deletion e2e/linter/src/linter.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ describe('Linter', () => {
return config;
});
expect(() => runCLI(`lint ${myapp} --linter=tslint`)).toThrow(
/'tslint' option is no longer supported/
/"@nrwl\/linter:lint" was deprecated in v10 and is no longer supported\. Update your angular\.json to use "@nrwl\/linter:eslint" builder instead\./
);
expect(() => runCLI(`lint ${myapp} --linter=random`)).toThrow(
/'random' should be one of eslint,tslint/
Expand Down
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@
"@angular-devkit/build-webpack": "0.1300.1",
"@angular-devkit/core": "~13.0.0",
"@angular-devkit/schematics": "~13.0.0",
"@angular-eslint/eslint-plugin": "~13.0.0",
"@angular-eslint/eslint-plugin-template": "~13.0.0",
"@angular-eslint/template-parser": "~13.0.0",
"@angular-eslint/eslint-plugin": "~13.0.1",
"@angular-eslint/eslint-plugin-template": "~13.0.1",
"@angular-eslint/template-parser": "~13.0.1",
"@angular/cli": "~13.0.0",
"@angular/common": "^13.0.0",
"@angular/compiler": "^13.0.0",
Expand Down Expand Up @@ -95,7 +95,7 @@
"@testing-library/react-hooks": "7.0.1",
"@types/css-minimizer-webpack-plugin": "^3.0.2",
"@types/cytoscape": "^3.14.12",
"@types/eslint": "^7.2.2",
"@types/eslint": "^8.2.0",
"@types/express": "4.17.0",
"@types/find-parent-dir": "^0.3.0",
"@types/flat": "^5.0.1",
Expand All @@ -113,9 +113,9 @@
"@types/semver": "^7.3.8",
"@types/tmp": "^0.2.0",
"@types/yargs": "^15.0.5",
"@typescript-eslint/eslint-plugin": "~4.33.0",
"@typescript-eslint/experimental-utils": "~4.33.0",
"@typescript-eslint/parser": "~4.33.0",
"@typescript-eslint/eslint-plugin": "~5.3.0",
"@typescript-eslint/experimental-utils": "~5.3.0",
"@typescript-eslint/parser": "~5.3.0",
"@xstate/immer": "^0.2.0",
"@xstate/inspect": "^0.5.1",
"angular": "1.8.0",
Expand All @@ -139,11 +139,11 @@
"dotenv": "~10.0.0",
"ejs": "^3.1.5",
"enhanced-resolve": "^5.8.3",
"eslint": "7.32.0",
"eslint": "8.2.0",
"eslint-config-next": "12.0.0",
"eslint-config-prettier": "^8.1.0",
"eslint-plugin-cypress": "^2.10.3",
"eslint-plugin-import": "2.22.1",
"eslint-plugin-import": "2.25.2",
"eslint-plugin-jsx-a11y": "6.4.1",
"eslint-plugin-react": "7.23.1",
"eslint-plugin-react-hooks": "4.2.0",
Expand Down
6 changes: 3 additions & 3 deletions packages/angular/migrations.json
Original file line number Diff line number Diff line change
Expand Up @@ -1118,15 +1118,15 @@
"version": "13.3.0-beta.0",
"packages": {
"@angular-eslint/eslint-plugin": {
"version": "~13.0.0",
"version": "~13.0.1",
"alwaysAddToPackageJson": false
},
"@angular-eslint/eslint-plugin-template": {
"version": "~13.0.0",
"version": "~13.0.1",
"alwaysAddToPackageJson": false
},
"@angular-eslint/template-parser": {
"version": "~13.0.0",
"version": "~13.0.1",
"alwaysAddToPackageJson": false
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -573,14 +573,14 @@ exports[`convert-tslint-to-eslint should work for Angular applications 1`] = `
Object {
"dependencies": Object {},
"devDependencies": Object {
"@angular-eslint/eslint-plugin": "~13.0.0",
"@angular-eslint/eslint-plugin-template": "~13.0.0",
"@angular-eslint/template-parser": "~13.0.0",
"@angular-eslint/eslint-plugin": "~13.0.1",
"@angular-eslint/eslint-plugin-template": "~13.0.1",
"@angular-eslint/template-parser": "~13.0.1",
"@nrwl/eslint-plugin-nx": "*",
"@nrwl/linter": "*",
"@typescript-eslint/eslint-plugin": "~4.33.0",
"@typescript-eslint/parser": "~4.33.0",
"eslint": "7.32.0",
"@typescript-eslint/eslint-plugin": "~5.3.0",
"@typescript-eslint/parser": "~5.3.0",
"eslint": "8.2.0",
"eslint-config-prettier": "8.1.0",
"eslint-plugin-import": "latest",
},
Expand Down Expand Up @@ -931,14 +931,14 @@ exports[`convert-tslint-to-eslint should work for Angular libraries 1`] = `
Object {
"dependencies": Object {},
"devDependencies": Object {
"@angular-eslint/eslint-plugin": "~13.0.0",
"@angular-eslint/eslint-plugin-template": "~13.0.0",
"@angular-eslint/template-parser": "~13.0.0",
"@angular-eslint/eslint-plugin": "~13.0.1",
"@angular-eslint/eslint-plugin-template": "~13.0.1",
"@angular-eslint/template-parser": "~13.0.1",
"@nrwl/eslint-plugin-nx": "*",
"@nrwl/linter": "*",
"@typescript-eslint/eslint-plugin": "~4.33.0",
"@typescript-eslint/parser": "~4.33.0",
"eslint": "7.32.0",
"@typescript-eslint/eslint-plugin": "~5.3.0",
"@typescript-eslint/parser": "~5.3.0",
"eslint": "8.2.0",
"eslint-config-prettier": "8.1.0",
"eslint-plugin-import": "latest",
},
Expand Down
2 changes: 1 addition & 1 deletion packages/angular/src/utils/versions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ export const angularJsVersion = '1.7.9';
export const ngrxVersion = '~13.0.0';
export const rxjsVersion = '~7.4.0';
export const jestPresetAngularVersion = '11.0.0';
export const angularEslintVersion = '~13.0.0';
export const angularEslintVersion = '~13.0.1';
export const storybookVersion = '~6.4.0-rc.3';
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ Object {
"devDependencies": Object {
"@nrwl/eslint-plugin-nx": "*",
"@nrwl/linter": "*",
"@typescript-eslint/eslint-plugin": "~4.33.0",
"@typescript-eslint/parser": "~4.33.0",
"eslint": "7.32.0",
"@typescript-eslint/eslint-plugin": "~5.3.0",
"@typescript-eslint/parser": "~5.3.0",
"eslint": "8.2.0",
"eslint-config-prettier": "8.1.0",
"eslint-plugin-cypress": "^2.10.3",
"eslint-plugin-import": "latest",
Expand Down
4 changes: 2 additions & 2 deletions packages/eslint-plugin-nx/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@
},
"homepage": "https://nx.dev",
"peerDependencies": {
"@typescript-eslint/parser": "~4.33.0",
"@typescript-eslint/parser": "~5.3.0",
"eslint-config-prettier": "^8.1.0"
},
"dependencies": {
"@nrwl/devkit": "*",
"@nrwl/workspace": "*",
"@typescript-eslint/experimental-utils": "~4.33.0",
"@typescript-eslint/experimental-utils": "~5.3.0",
"confusing-browser-globals": "^1.0.9",
"ts-node": "^9.1.1",
"tsconfig-paths": "^3.9.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ export default createESLintRule<Options, MessageIds>({
type: 'suggestion',
docs: {
description: `Ensure that module boundaries are respected within the monorepo`,
category: 'Best Practices',
recommended: 'error',
},
fixable: 'code',
Expand Down
17 changes: 17 additions & 0 deletions packages/linter/migrations.json
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,23 @@
"version": "7.32.0"
}
}
},
"13.3.0": {
"version": "13.3.0-beta.0",
"packages": {
"@typescript-eslint/parser": {
"version": "~5.3.0"
},
"@typescript-eslint/eslint-plugin": {
"version": "~5.3.0"
},
"@typescript-eslint/experimental-utils": {
"version": "~5.3.0"
},
"eslint": {
"version": "8.2.0"
}
}
}
}
}
2 changes: 1 addition & 1 deletion packages/linter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"dependencies": {
"@nrwl/devkit": "*",
"@nrwl/jest": "*",
"eslint": "7.32.0",
"eslint": "8.2.0",
"glob": "7.1.4",
"minimatch": "3.0.4",
"tmp": "~0.2.1",
Expand Down
Loading

1 comment on commit 8fa36ff

@vercel
Copy link

@vercel vercel bot commented on 8fa36ff Nov 19, 2021

Choose a reason for hiding this comment

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

Please sign in to comment.