@nx/eslint-plugin 0.0.0-pr-31222-862e973 → 0.0.0-pr-31313-387cdca

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  (The MIT License)
2
2
 
3
- Copyright (c) 2017-2024 Narwhal Technologies Inc.
3
+ Copyright (c) 2017-2025 Narwhal Technologies Inc.
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining
6
6
  a copy of this software and associated documentation files (the
package/README.md CHANGED
@@ -9,7 +9,7 @@
9
9
 
10
10
  [![CircleCI](https://circleci.com/gh/nrwl/nx.svg?style=svg)](https://circleci.com/gh/nrwl/nx)
11
11
  [![License](https://img.shields.io/npm/l/@nx/workspace.svg?style=flat-square)]()
12
- [![NPM Version](https://badge.fury.io/js/%40nrwl%2Fworkspace.svg)](https://www.npmjs.com/@nx/workspace)
12
+ [![NPM Version](https://badge.fury.io/js/nx.svg)](https://www.npmjs.com/package/nx)
13
13
  [![Semantic Release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=flat-square)]()
14
14
  [![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
15
15
  [![Join the chat at https://gitter.im/nrwl-nx/community](https://badges.gitter.im/nrwl-nx/community.svg)](https://gitter.im/nrwl-nx/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
package/migrations.json CHANGED
@@ -1,17 +1,5 @@
1
1
  {
2
2
  "generators": {
3
- "update-16-0-0-add-nx-packages": {
4
- "cli": "nx",
5
- "version": "16.0.0-beta.1",
6
- "description": "Replace @nrwl/eslint-plugin-nx with @nx/eslint-plugin",
7
- "implementation": "./src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages"
8
- },
9
- "update-17-2-6-rename-workspace-rules": {
10
- "cli": "nx",
11
- "version": "17.2.6-beta.1",
12
- "description": "Rename workspace rules from @nx/workspace/name to @nx/workspace-name",
13
- "implementation": "./src/migrations/update-17-2-6-rename-workspace-rules/rename-workspace-rules"
14
- },
15
3
  "update-19-1-0-rename-no-extra-semi": {
16
4
  "cli": "nx",
17
5
  "version": "19.1.0-beta.6",
package/nx.d.ts CHANGED
@@ -1,24 +1,8 @@
1
1
  declare const plugin: {
2
2
  configs: {};
3
3
  rules: {
4
- "enforce-module-boundaries": import("@typescript-eslint/utils/ts-eslint").RuleModule<import("./src/rules/enforce-module-boundaries").MessageIds, [{
5
- allow: string[];
6
- buildTargets: string[];
7
- depConstraints: import("./src/utils/runtime-lint-utils").DepConstraint[];
8
- enforceBuildableLibDependency: boolean;
9
- allowCircularSelfDependency: boolean;
10
- ignoredCircularDependencies: Array<[string, string]>;
11
- checkDynamicDependenciesExceptions: string[];
12
- banTransitiveDependencies: boolean;
13
- checkNestedExternalImports: boolean;
14
- }], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
15
- "nx-plugin-checks": import("@typescript-eslint/utils/ts-eslint").RuleModule<import("./src/rules/nx-plugin-checks").MessageIds, [{
16
- generatorsJson?: string;
17
- executorsJson?: string;
18
- migrationsJson?: string;
19
- packageJson?: string;
20
- allowedVersionStrings: string[];
21
- }], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
4
+ "enforce-module-boundaries": import("@typescript-eslint/utils/ts-eslint").RuleModule<import("./src/rules/enforce-module-boundaries").MessageIds, import("./src/rules/enforce-module-boundaries").Options, unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
5
+ "nx-plugin-checks": import("@typescript-eslint/utils/ts-eslint").RuleModule<import("./src/rules/nx-plugin-checks").MessageIds, import("./src/rules/nx-plugin-checks").Options, unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
22
6
  "dependency-checks": import("@typescript-eslint/utils/ts-eslint").RuleModule<import("./src/rules/dependency-checks").MessageIds, import("./src/rules/dependency-checks").Options, unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
23
7
  };
24
8
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/eslint-plugin",
3
- "version": "0.0.0-pr-31222-862e973",
3
+ "version": "0.0.0-pr-31313-387cdca",
4
4
  "private": false,
5
5
  "description": "The eslint-plugin package is an ESLint plugin that contains a collection of recommended ESLint rule configurations which you can extend from in your own ESLint configs, as well as an Nx-specific lint rule called enforce-module-boundaries.",
6
6
  "repository": {
@@ -26,7 +26,7 @@
26
26
  "homepage": "https://nx.dev",
27
27
  "peerDependencies": {
28
28
  "@typescript-eslint/parser": "^6.13.2 || ^7.0.0 || ^8.0.0",
29
- "eslint-config-prettier": "^9.0.0"
29
+ "eslint-config-prettier": "^10.0.0"
30
30
  },
31
31
  "peerDependenciesMeta": {
32
32
  "eslint-config-prettier": {
@@ -34,9 +34,8 @@
34
34
  }
35
35
  },
36
36
  "dependencies": {
37
- "@eslint/compat": "^1.1.1",
38
- "@nx/devkit": "0.0.0-pr-31222-862e973",
39
- "@nx/js": "0.0.0-pr-31222-862e973",
37
+ "@nx/devkit": "0.0.0-pr-31313-387cdca",
38
+ "@nx/js": "0.0.0-pr-31313-387cdca",
40
39
  "@typescript-eslint/type-utils": "^8.0.0",
41
40
  "@typescript-eslint/utils": "^8.0.0",
42
41
  "chalk": "^4.1.0",
@@ -44,8 +43,7 @@
44
43
  "globals": "^15.9.0",
45
44
  "jsonc-eslint-parser": "^2.1.0",
46
45
  "semver": "^7.5.3",
47
- "tslib": "^2.3.0",
48
- "@nrwl/eslint-plugin-nx": "0.0.0-pr-31222-862e973"
46
+ "tslib": "^2.3.0"
49
47
  },
50
48
  "publishConfig": {
51
49
  "access": "public"
@@ -53,6 +51,6 @@
53
51
  "nx-migrations": {
54
52
  "migrations": "./migrations.json"
55
53
  },
56
- "type": "commonjs",
57
- "types": "./src/index.d.ts"
54
+ "types": "./src/index.d.ts",
55
+ "type": "commonjs"
58
56
  }
@@ -44,7 +44,7 @@ declare const _default: {
44
44
  * previously defined v5 of `@typescript-eslint`. v6 of `@typescript-eslint`
45
45
  * changed how configurations are defined.
46
46
  *
47
- * TODO(v20): re-evalute these deviations from @typescript-eslint/recommended in v20 of Nx
47
+ * TODO(eslint): re-evalute these deviations from @typescript-eslint/recommended in v20 of Nx
48
48
  */
49
49
  '@typescript-eslint/no-non-null-assertion': string;
50
50
  '@typescript-eslint/adjacent-overload-signatures': string;
@@ -59,7 +59,7 @@ declare const _default: {
59
59
  * During the migration to use ESLint v9 and typescript-eslint v8 for new workspaces,
60
60
  * this rule would have created a lot of noise, so we are disabling it by default for now.
61
61
  *
62
- * TODO(v20): we should make this part of what we re-evaluate in v20
62
+ * TODO(eslint): we should make this part of what we re-evaluate in v20
63
63
  */
64
64
  '@typescript-eslint/no-require-imports': string;
65
65
  };
@@ -53,7 +53,7 @@ exports.default = {
53
53
  * previously defined v5 of `@typescript-eslint`. v6 of `@typescript-eslint`
54
54
  * changed how configurations are defined.
55
55
  *
56
- * TODO(v20): re-evalute these deviations from @typescript-eslint/recommended in v20 of Nx
56
+ * TODO(eslint): re-evalute these deviations from @typescript-eslint/recommended in v20 of Nx
57
57
  */
58
58
  '@typescript-eslint/no-non-null-assertion': 'warn',
59
59
  '@typescript-eslint/adjacent-overload-signatures': 'error',
@@ -68,7 +68,7 @@ exports.default = {
68
68
  * During the migration to use ESLint v9 and typescript-eslint v8 for new workspaces,
69
69
  * this rule would have created a lot of noise, so we are disabling it by default for now.
70
70
  *
71
- * TODO(v20): we should make this part of what we re-evaluate in v20
71
+ * TODO(eslint): we should make this part of what we re-evaluate in v20
72
72
  */
73
73
  '@typescript-eslint/no-require-imports': 'off',
74
74
  },
@@ -26,7 +26,7 @@ declare const _default: {
26
26
  * previously defined v5 of `@typescript-eslint`. v6 of `@typescript-eslint`
27
27
  * changed how configurations are defined.
28
28
  *
29
- * TODO(v20): re-evalute these deviations from @typescript-eslint/recommended in v20 of Nx
29
+ * TODO(eslint): re-evalute these deviations from @typescript-eslint/recommended in v20 of Nx
30
30
  */
31
31
  '@typescript-eslint/no-non-null-assertion': string;
32
32
  '@typescript-eslint/adjacent-overload-signatures': string;
@@ -41,7 +41,7 @@ declare const _default: {
41
41
  * During the migration to use ESLint v9 and typescript-eslint v8 for new workspaces,
42
42
  * this rule would have created a lot of noise, so we are disabling it by default for now.
43
43
  *
44
- * TODO(v20): we should make this part of what we re-evaluate in v20
44
+ * TODO(eslint): we should make this part of what we re-evaluate in v20
45
45
  */
46
46
  '@typescript-eslint/no-require-imports': string;
47
47
  };
@@ -36,7 +36,7 @@ exports.default = {
36
36
  * previously defined v5 of `@typescript-eslint`. v6 of `@typescript-eslint`
37
37
  * changed how configurations are defined.
38
38
  *
39
- * TODO(v20): re-evalute these deviations from @typescript-eslint/recommended in v20 of Nx
39
+ * TODO(eslint): re-evalute these deviations from @typescript-eslint/recommended in v20 of Nx
40
40
  */
41
41
  '@typescript-eslint/no-non-null-assertion': 'warn',
42
42
  '@typescript-eslint/adjacent-overload-signatures': 'error',
@@ -51,7 +51,7 @@ exports.default = {
51
51
  * During the migration to use ESLint v9 and typescript-eslint v8 for new workspaces,
52
52
  * this rule would have created a lot of noise, so we are disabling it by default for now.
53
53
  *
54
- * TODO(v20): we should make this part of what we re-evaluate in v20
54
+ * TODO(eslint): we should make this part of what we re-evaluate in v20
55
55
  */
56
56
  '@typescript-eslint/no-require-imports': 'off',
57
57
  },
@@ -22,7 +22,10 @@ const isPrettierAvailable = (0, config_utils_1.packageExists)('prettier') && (0,
22
22
  * breaking changes - we should also look to replace all the @typescript-eslint
23
23
  * related plugins and rules below.
24
24
  */
25
- exports.default = typescript_eslint_1.default.config(js_1.default.configs.recommended, ...typescript_eslint_1.default.configs.recommended, ...(isPrettierAvailable ? [require('eslint-config-prettier')] : []), {
25
+ exports.default = typescript_eslint_1.default.config({
26
+ files: ['**/*.js', '**/*.jsx', '**/*.cjs', '**/*.mjs'],
27
+ extends: [js_1.default.configs.recommended, ...typescript_eslint_1.default.configs.recommended],
28
+ }, {
26
29
  languageOptions: {
27
30
  parser: typescript_eslint_1.default.parser,
28
31
  ecmaVersion: 2020,
@@ -34,7 +37,7 @@ exports.default = typescript_eslint_1.default.config(js_1.default.configs.recomm
34
37
  },
35
38
  plugins: { '@typescript-eslint': typescript_eslint_1.default.plugin },
36
39
  }, {
37
- files: ['**/*.js', '**/*.jsx'],
40
+ files: ['**/*.js', '**/*.jsx', '**/*.cjs', '**/*.mjs'],
38
41
  rules: {
39
42
  '@typescript-eslint/explicit-member-accessibility': 'off',
40
43
  '@typescript-eslint/explicit-module-boundary-types': 'off',
@@ -53,7 +56,7 @@ exports.default = typescript_eslint_1.default.config(js_1.default.configs.recomm
53
56
  * previously defined v5 of `@typescript-eslint`. v6 of `@typescript-eslint`
54
57
  * changed how configurations are defined.
55
58
  *
56
- * TODO(v20): re-evalute these deviations from @typescript-eslint/recommended in v20 of Nx
59
+ * TODO(eslint): re-evalute these deviations from @typescript-eslint/recommended in v20 of Nx
57
60
  */
58
61
  '@typescript-eslint/no-non-null-assertion': 'warn',
59
62
  '@typescript-eslint/adjacent-overload-signatures': 'error',
@@ -68,8 +71,12 @@ exports.default = typescript_eslint_1.default.config(js_1.default.configs.recomm
68
71
  * During the migration to use ESLint v9 and typescript-eslint v8 for new workspaces,
69
72
  * this rule would have created a lot of noise, so we are disabling it by default for now.
70
73
  *
71
- * TODO(v20): we should make this part of what we re-evaluate in v20
74
+ * TODO(eslint): we should make this part of what we re-evaluate in v20
72
75
  */
73
76
  '@typescript-eslint/no-require-imports': 'off',
74
77
  },
75
- });
78
+ },
79
+ /**
80
+ * We include it last so it overrides the conflicting rules from the configuration blocks above.
81
+ */
82
+ ...(isPrettierAvailable ? [require('eslint-config-prettier')] : []));
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
- const compat_1 = require("@eslint/compat");
5
4
  const importPlugin = tslib_1.__importStar(require("eslint-plugin-import"));
6
5
  const globals_1 = tslib_1.__importDefault(require("globals"));
7
6
  const typescript_eslint_1 = tslib_1.__importDefault(require("typescript-eslint"));
@@ -20,7 +19,17 @@ const typescript_eslint_1 = tslib_1.__importDefault(require("typescript-eslint")
20
19
  * https://github.com/facebook/create-react-app/blob/567f36c9235f1e1fd4a76dc6d1ae00be754ca047/packages/eslint-config-react-app/index.js
21
20
  */
22
21
  exports.default = typescript_eslint_1.default.config({
23
- plugins: { import: (0, compat_1.fixupPluginRules)(importPlugin) },
22
+ files: [
23
+ '**/*.ts',
24
+ '**/*.cts',
25
+ '**/*.mts',
26
+ '**/*.tsx',
27
+ '**/*.js',
28
+ '**/*.cjs',
29
+ '**/*.mjs',
30
+ '**/*.jsx',
31
+ ],
32
+ plugins: { import: importPlugin },
24
33
  languageOptions: {
25
34
  globals: {
26
35
  ...globals_1.default.browser,
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
- const compat_1 = require("@eslint/compat");
5
4
  const eslint_plugin_jsx_a11y_1 = tslib_1.__importDefault(require("eslint-plugin-jsx-a11y"));
6
5
  const eslint_plugin_react_1 = tslib_1.__importDefault(require("eslint-plugin-react"));
7
6
  const eslint_plugin_react_hooks_1 = tslib_1.__importDefault(require("eslint-plugin-react-hooks"));
@@ -17,11 +16,31 @@ const typescript_eslint_1 = tslib_1.__importDefault(require("typescript-eslint")
17
16
  * package.
18
17
  */
19
18
  exports.default = typescript_eslint_1.default.config({
19
+ files: [
20
+ '**/*.ts',
21
+ '**/*.cts',
22
+ '**/*.mts',
23
+ '**/*.tsx',
24
+ '**/*.js',
25
+ '**/*.cjs',
26
+ '**/*.mjs',
27
+ '**/*.jsx',
28
+ ],
20
29
  plugins: {
21
- 'react-hooks': (0, compat_1.fixupPluginRules)(eslint_plugin_react_hooks_1.default),
30
+ 'react-hooks': eslint_plugin_react_hooks_1.default,
22
31
  },
23
32
  rules: eslint_plugin_react_hooks_1.default.configs.recommended.rules,
24
33
  }, {
34
+ files: [
35
+ '**/*.ts',
36
+ '**/*.cts',
37
+ '**/*.mts',
38
+ '**/*.tsx',
39
+ '**/*.js',
40
+ '**/*.cjs',
41
+ '**/*.mjs',
42
+ '**/*.jsx',
43
+ ],
25
44
  settings: { react: { version: 'detect' } },
26
45
  plugins: {
27
46
  'jsx-a11y': eslint_plugin_jsx_a11y_1.default,
@@ -13,6 +13,16 @@ const typescript_eslint_1 = tslib_1.__importDefault(require("typescript-eslint")
13
13
  * package.
14
14
  */
15
15
  exports.default = typescript_eslint_1.default.config({
16
+ files: [
17
+ '**/*.ts',
18
+ '**/*.cts',
19
+ '**/*.mts',
20
+ '**/*.tsx',
21
+ '**/*.js',
22
+ '**/*.cjs',
23
+ '**/*.mjs',
24
+ '**/*.jsx',
25
+ ],
16
26
  rules: {
17
27
  // TypeScript"s `noFallthroughCasesInSwitch` option is more robust (#6906)
18
28
  'default-case': 'off',
@@ -13,7 +13,10 @@ const isPrettierAvailable = (0, config_utils_1.packageExists)('prettier') && (0,
13
13
  * It should therefore NOT contain any rules or plugins which are specific
14
14
  * to one ecosystem, such as React, Angular, Node etc.
15
15
  */
16
- exports.default = typescript_eslint_1.default.config(js_1.default.configs.recommended, ...typescript_eslint_1.default.configs.recommended, ...(isPrettierAvailable ? [require('eslint-config-prettier')] : []), {
16
+ exports.default = typescript_eslint_1.default.config({
17
+ files: ['**/*.ts', '**/*.tsx', '**/*.cts', '**/*.mts'],
18
+ extends: [js_1.default.configs.recommended, ...typescript_eslint_1.default.configs.recommended],
19
+ }, {
17
20
  plugins: { '@typescript-eslint': typescript_eslint_1.default.plugin },
18
21
  languageOptions: {
19
22
  parser: typescript_eslint_1.default.parser,
@@ -24,7 +27,7 @@ exports.default = typescript_eslint_1.default.config(js_1.default.configs.recomm
24
27
  },
25
28
  },
26
29
  }, {
27
- files: ['**/*.ts', '**/*.tsx'],
30
+ files: ['**/*.ts', '**/*.tsx', '**/*.cts', '**/*.mts'],
28
31
  rules: {
29
32
  '@typescript-eslint/explicit-member-accessibility': 'off',
30
33
  '@typescript-eslint/explicit-module-boundary-types': 'off',
@@ -37,7 +40,7 @@ exports.default = typescript_eslint_1.default.config(js_1.default.configs.recomm
37
40
  * previously defined v5 of `@typescript-eslint`. v6 of `@typescript-eslint`
38
41
  * changed how configurations are defined.
39
42
  *
40
- * TODO(v20): re-evalute these deviations from @typescript-eslint/recommended in v20 of Nx
43
+ * TODO(eslint): re-evalute these deviations from @typescript-eslint/recommended in v20 of Nx
41
44
  */
42
45
  '@typescript-eslint/no-non-null-assertion': 'warn',
43
46
  '@typescript-eslint/adjacent-overload-signatures': 'error',
@@ -52,8 +55,12 @@ exports.default = typescript_eslint_1.default.config(js_1.default.configs.recomm
52
55
  * During the migration to use ESLint v9 and typescript-eslint v8 for new workspaces,
53
56
  * this rule would have created a lot of noise, so we are disabling it by default for now.
54
57
  *
55
- * TODO(v20): we should make this part of what we re-evaluate in v20
58
+ * TODO(eslint): we should make this part of what we re-evaluate in v20
56
59
  */
57
60
  '@typescript-eslint/no-require-imports': 'off',
58
61
  },
59
- });
62
+ },
63
+ /**
64
+ * We include it last so it overrides the conflicting rules from the configuration blocks above.
65
+ */
66
+ ...(isPrettierAvailable ? [require('eslint-config-prettier')] : []));