@nx/eslint-plugin 23.0.0-beta.2 → 23.0.0-beta.20
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/{angular.d.ts → dist/angular.d.ts} +0 -1
- package/{nx.d.ts → dist/nx.d.ts} +9 -4
- package/{react.d.ts → dist/react.d.ts} +0 -1
- package/{src → dist/src}/configs/angular-template.d.ts +0 -1
- package/{src → dist/src}/configs/angular.d.ts +0 -1
- package/{src → dist/src}/configs/javascript.d.ts +0 -1
- package/{src → dist/src}/configs/react-base.d.ts +0 -1
- package/{src → dist/src}/configs/react-jsx.d.ts +0 -1
- package/{src → dist/src}/configs/react-tmp.d.ts +0 -1
- package/{src → dist/src}/configs/react-typescript.d.ts +0 -1
- package/{src → dist/src}/configs/typescript.d.ts +0 -1
- package/{src → dist/src}/constants.d.ts +0 -1
- package/{src → dist/src}/flat-configs/angular-template.d.ts +0 -1
- package/{src → dist/src}/flat-configs/angular.d.ts +0 -1
- package/{src → dist/src}/flat-configs/base.d.ts +0 -1
- package/{src → dist/src}/flat-configs/javascript.d.ts +0 -1
- package/{src → dist/src}/flat-configs/react-base.d.ts +0 -1
- package/{src → dist/src}/flat-configs/react-jsx.d.ts +0 -1
- package/{src → dist/src}/flat-configs/react-tmp.d.ts +0 -1
- package/{src → dist/src}/flat-configs/react-typescript.d.ts +0 -1
- package/{src → dist/src}/flat-configs/typescript.d.ts +0 -1
- package/{src → dist/src}/index.d.ts +18 -7
- package/{src → dist/src}/resolve-workspace-rules.d.ts +0 -1
- package/{src → dist/src}/resolve-workspace-rules.js +68 -21
- package/{src → dist/src}/rules/dependency-checks.d.ts +3 -2
- package/{src → dist/src}/rules/dependency-checks.js +19 -6
- package/{src → dist/src}/rules/enforce-module-boundaries.d.ts +3 -2
- package/{src → dist/src}/rules/enforce-module-boundaries.js +1 -1
- package/{src → dist/src}/rules/nx-plugin-checks.d.ts +10 -11
- package/{src → dist/src}/rules/nx-plugin-checks.js +79 -77
- package/{src → dist/src}/utils/ast-utils.d.ts +0 -1
- package/{src → dist/src}/utils/ast-utils.js +5 -2
- package/{src → dist/src}/utils/config-utils.d.ts +0 -1
- package/{src → dist/src}/utils/graph-utils.d.ts +0 -1
- package/{src → dist/src}/utils/package-json-utils.d.ts +0 -1
- package/{src → dist/src}/utils/project-graph-utils.d.ts +1 -2
- package/{src → dist/src}/utils/project-graph-utils.js +1 -1
- package/{src → dist/src}/utils/runtime-lint-utils.d.ts +1 -2
- package/{src → dist/src}/utils/runtime-lint-utils.js +1 -2
- package/{typescript.d.ts → dist/typescript.d.ts} +0 -1
- package/package.json +64 -13
- package/angular.d.ts.map +0 -1
- package/nx.d.ts.map +0 -1
- package/react.d.ts.map +0 -1
- package/src/configs/angular-template.d.ts.map +0 -1
- package/src/configs/angular.d.ts.map +0 -1
- package/src/configs/javascript.d.ts.map +0 -1
- package/src/configs/react-base.d.ts.map +0 -1
- package/src/configs/react-jsx.d.ts.map +0 -1
- package/src/configs/react-tmp.d.ts.map +0 -1
- package/src/configs/react-typescript.d.ts.map +0 -1
- package/src/configs/typescript.d.ts.map +0 -1
- package/src/constants.d.ts.map +0 -1
- package/src/flat-configs/angular-template.d.ts.map +0 -1
- package/src/flat-configs/angular.d.ts.map +0 -1
- package/src/flat-configs/base.d.ts.map +0 -1
- package/src/flat-configs/javascript.d.ts.map +0 -1
- package/src/flat-configs/react-base.d.ts.map +0 -1
- package/src/flat-configs/react-jsx.d.ts.map +0 -1
- package/src/flat-configs/react-tmp.d.ts.map +0 -1
- package/src/flat-configs/react-typescript.d.ts.map +0 -1
- package/src/flat-configs/typescript.d.ts.map +0 -1
- package/src/index.d.ts.map +0 -1
- package/src/resolve-workspace-rules.d.ts.map +0 -1
- package/src/rules/dependency-checks.d.ts.map +0 -1
- package/src/rules/enforce-module-boundaries.d.ts.map +0 -1
- package/src/rules/nx-plugin-checks.d.ts.map +0 -1
- package/src/utils/ast-utils.d.ts.map +0 -1
- package/src/utils/config-utils.d.ts.map +0 -1
- package/src/utils/graph-utils.d.ts.map +0 -1
- package/src/utils/package-json-utils.d.ts.map +0 -1
- package/src/utils/project-graph-utils.d.ts.map +0 -1
- package/src/utils/runtime-lint-utils.d.ts.map +0 -1
- package/typescript.d.ts.map +0 -1
- /package/{LICENSE → dist/LICENSE} +0 -0
- /package/{angular.js → dist/angular.js} +0 -0
- /package/{nx.js → dist/nx.js} +0 -0
- /package/{react.js → dist/react.js} +0 -0
- /package/{src → dist/src}/configs/angular-template.js +0 -0
- /package/{src → dist/src}/configs/angular.js +0 -0
- /package/{src → dist/src}/configs/javascript.js +0 -0
- /package/{src → dist/src}/configs/react-base.js +0 -0
- /package/{src → dist/src}/configs/react-jsx.js +0 -0
- /package/{src → dist/src}/configs/react-tmp.js +0 -0
- /package/{src → dist/src}/configs/react-typescript.js +0 -0
- /package/{src → dist/src}/configs/typescript.js +0 -0
- /package/{src → dist/src}/constants.js +0 -0
- /package/{src → dist/src}/flat-configs/angular-template.js +0 -0
- /package/{src → dist/src}/flat-configs/angular.js +0 -0
- /package/{src → dist/src}/flat-configs/base.js +0 -0
- /package/{src → dist/src}/flat-configs/javascript.js +0 -0
- /package/{src → dist/src}/flat-configs/react-base.js +0 -0
- /package/{src → dist/src}/flat-configs/react-jsx.js +0 -0
- /package/{src → dist/src}/flat-configs/react-tmp.js +0 -0
- /package/{src → dist/src}/flat-configs/react-typescript.js +0 -0
- /package/{src → dist/src}/flat-configs/typescript.js +0 -0
- /package/{src → dist/src}/index.js +0 -0
- /package/{src → dist/src}/utils/config-utils.js +0 -0
- /package/{src → dist/src}/utils/graph-utils.js +0 -0
- /package/{src → dist/src}/utils/package-json-utils.js +0 -0
- /package/{typescript.js → dist/typescript.js} +0 -0
package/{nx.d.ts → dist/nx.d.ts}
RENAMED
|
@@ -1,10 +1,15 @@
|
|
|
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, import("./src/rules/enforce-module-boundaries").Options, unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener
|
|
5
|
-
|
|
6
|
-
|
|
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
|
+
name: string;
|
|
6
|
+
};
|
|
7
|
+
"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> & {
|
|
8
|
+
name: string;
|
|
9
|
+
};
|
|
10
|
+
"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> & {
|
|
11
|
+
name: string;
|
|
12
|
+
};
|
|
7
13
|
};
|
|
8
14
|
};
|
|
9
15
|
export default plugin;
|
|
10
|
-
//# sourceMappingURL=nx.d.ts.map
|
|
@@ -273,9 +273,15 @@ declare const configs: {
|
|
|
273
273
|
readonly "flat/angular-template": typeof import("./flat-configs/angular-template").default;
|
|
274
274
|
};
|
|
275
275
|
declare const rules: {
|
|
276
|
-
"enforce-module-boundaries": import("@typescript-eslint/utils/ts-eslint").RuleModule<import("./rules/enforce-module-boundaries").MessageIds, import("./rules/enforce-module-boundaries").Options, unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener
|
|
277
|
-
|
|
278
|
-
|
|
276
|
+
"enforce-module-boundaries": import("@typescript-eslint/utils/ts-eslint").RuleModule<import("./rules/enforce-module-boundaries").MessageIds, import("./rules/enforce-module-boundaries").Options, unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
277
|
+
name: string;
|
|
278
|
+
};
|
|
279
|
+
"nx-plugin-checks": import("@typescript-eslint/utils/ts-eslint").RuleModule<import("./rules/nx-plugin-checks").MessageIds, import("./rules/nx-plugin-checks").Options, unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
280
|
+
name: string;
|
|
281
|
+
};
|
|
282
|
+
"dependency-checks": import("@typescript-eslint/utils/ts-eslint").RuleModule<import("./rules/dependency-checks").MessageIds, import("./rules/dependency-checks").Options, unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
283
|
+
name: string;
|
|
284
|
+
};
|
|
279
285
|
};
|
|
280
286
|
declare const _default: {
|
|
281
287
|
configs: {
|
|
@@ -552,11 +558,16 @@ declare const _default: {
|
|
|
552
558
|
readonly "flat/angular-template": typeof import("./flat-configs/angular-template").default;
|
|
553
559
|
};
|
|
554
560
|
rules: {
|
|
555
|
-
"enforce-module-boundaries": import("@typescript-eslint/utils/ts-eslint").RuleModule<import("./rules/enforce-module-boundaries").MessageIds, import("./rules/enforce-module-boundaries").Options, unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener
|
|
556
|
-
|
|
557
|
-
|
|
561
|
+
"enforce-module-boundaries": import("@typescript-eslint/utils/ts-eslint").RuleModule<import("./rules/enforce-module-boundaries").MessageIds, import("./rules/enforce-module-boundaries").Options, unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
562
|
+
name: string;
|
|
563
|
+
};
|
|
564
|
+
"nx-plugin-checks": import("@typescript-eslint/utils/ts-eslint").RuleModule<import("./rules/nx-plugin-checks").MessageIds, import("./rules/nx-plugin-checks").Options, unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
565
|
+
name: string;
|
|
566
|
+
};
|
|
567
|
+
"dependency-checks": import("@typescript-eslint/utils/ts-eslint").RuleModule<import("./rules/dependency-checks").MessageIds, import("./rules/dependency-checks").Options, unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
568
|
+
name: string;
|
|
569
|
+
};
|
|
558
570
|
};
|
|
559
571
|
};
|
|
560
572
|
export default _default;
|
|
561
573
|
export { configs, rules, loadWorkspaceRules };
|
|
562
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -36,4 +36,3 @@ type ESLintRules = Record<string, TSESLint.RuleModule<string, unknown[]>>;
|
|
|
36
36
|
export declare function loadWorkspaceRules(directory: string, tsConfigPath?: string): Promise<ESLintRules>;
|
|
37
37
|
export declare const workspaceRules: ESLintRules;
|
|
38
38
|
export {};
|
|
39
|
-
//# sourceMappingURL=resolve-workspace-rules.d.ts.map
|
|
@@ -3,11 +3,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.workspaceRules = void 0;
|
|
4
4
|
exports.loadWorkspaceRules = loadWorkspaceRules;
|
|
5
5
|
const devkit_1 = require("@nx/devkit");
|
|
6
|
-
const
|
|
7
|
-
const
|
|
6
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
7
|
+
const internal_2 = require("@nx/js/internal");
|
|
8
8
|
const fs_1 = require("fs");
|
|
9
|
+
const node_url_1 = require("node:url");
|
|
9
10
|
const path_1 = require("path");
|
|
10
11
|
const constants_1 = require("./constants");
|
|
12
|
+
// `new Function` keeps TS from down-leveling `import()` to `require()`.
|
|
13
|
+
const dynamicImport = new Function('p', 'return import(p);');
|
|
11
14
|
// ESM import() cannot resolve directories to index files like require() can
|
|
12
15
|
const INDEX_FILE_EXTENSIONS = [
|
|
13
16
|
'.ts',
|
|
@@ -109,15 +112,71 @@ async function loadWorkspaceRules(directory, tsConfigPath) {
|
|
|
109
112
|
console.warn(`Directory "${resolvedDirectory}" does not exist. Skipping loading ESLint rules from this directory.`);
|
|
110
113
|
return {};
|
|
111
114
|
}
|
|
112
|
-
let registrationCleanup = null;
|
|
113
115
|
try {
|
|
116
|
+
const entryFile = resolveDirectoryEntryFile(resolvedDirectory);
|
|
114
117
|
const effectiveTsConfigPath = findTsConfig(resolvedDirectory, tsConfigPath);
|
|
115
|
-
|
|
116
|
-
|
|
118
|
+
// For TS entry files, use loadTsFile directly so the explicitly-provided
|
|
119
|
+
// tsConfigPath threads into any swc/ts-node fallback. For other extensions
|
|
120
|
+
// (or when no tsconfig was found), defer to loadConfigFile's auto-discovery.
|
|
121
|
+
const isTs = !!effectiveTsConfigPath && /\.(c|m)?ts$/.test(entryFile);
|
|
122
|
+
let module;
|
|
123
|
+
if (isTs) {
|
|
124
|
+
try {
|
|
125
|
+
module = (0, internal_2.loadTsFile)(entryFile, effectiveTsConfigPath);
|
|
126
|
+
}
|
|
127
|
+
catch (err) {
|
|
128
|
+
// Top-level await (`ERR_REQUIRE_ASYNC_MODULE`) and ESM-only modules
|
|
129
|
+
// (`ERR_REQUIRE_ESM`) must be loaded via dynamic import(). Mirror
|
|
130
|
+
// devkit's loadTypeScriptModule: register tsconfig-paths first so
|
|
131
|
+
// workspace alias imports resolve, then try native dynamic import.
|
|
132
|
+
// Only escalate to forceRegisterEsmLoader on unsupported TS syntax
|
|
133
|
+
// (enum, runtime namespace, etc.) - surface the original ESM error
|
|
134
|
+
// if no loader can be installed. Without this the outer catch
|
|
135
|
+
// swallows the error and the lint run silently has no rules.
|
|
136
|
+
if (err?.code !== 'ERR_REQUIRE_ESM' &&
|
|
137
|
+
err?.code !== 'ERR_REQUIRE_ASYNC_MODULE') {
|
|
138
|
+
throw err;
|
|
139
|
+
}
|
|
140
|
+
const cleanupPaths = (0, internal_2.registerTsConfigPaths)(effectiveTsConfigPath);
|
|
141
|
+
try {
|
|
142
|
+
const entryUrl = (0, node_url_1.pathToFileURL)(entryFile).href;
|
|
143
|
+
try {
|
|
144
|
+
module = await dynamicImport(entryUrl);
|
|
145
|
+
}
|
|
146
|
+
catch (esmErr) {
|
|
147
|
+
if (esmErr?.code !== 'ERR_UNSUPPORTED_TYPESCRIPT_SYNTAX') {
|
|
148
|
+
throw esmErr;
|
|
149
|
+
}
|
|
150
|
+
try {
|
|
151
|
+
(0, internal_2.forceRegisterEsmLoader)();
|
|
152
|
+
}
|
|
153
|
+
catch {
|
|
154
|
+
throw esmErr;
|
|
155
|
+
}
|
|
156
|
+
module = await dynamicImport(entryUrl);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
finally {
|
|
160
|
+
cleanupPaths();
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
else {
|
|
165
|
+
// Pre-register tsconfig-paths so a `.js`/`.mjs`/`.cjs` workspace
|
|
166
|
+
// eslint plugin can still import workspace libs via TS path aliases
|
|
167
|
+
// (pre-PR behavior: loadConfigFile was always preceded by
|
|
168
|
+
// registerTsProject).
|
|
169
|
+
let cleanupPaths;
|
|
170
|
+
if (effectiveTsConfigPath) {
|
|
171
|
+
cleanupPaths = (0, internal_2.registerTsConfigPaths)(effectiveTsConfigPath);
|
|
172
|
+
}
|
|
173
|
+
try {
|
|
174
|
+
module = await (0, internal_1.loadConfigFile)(entryFile);
|
|
175
|
+
}
|
|
176
|
+
finally {
|
|
177
|
+
cleanupPaths?.();
|
|
178
|
+
}
|
|
117
179
|
}
|
|
118
|
-
const entryFile = resolveDirectoryEntryFile(resolvedDirectory);
|
|
119
|
-
// Only rules are supported (not configs, processors, etc.)
|
|
120
|
-
const module = await (0, config_utils_1.loadConfigFile)(entryFile);
|
|
121
180
|
const rules = module.rules || module;
|
|
122
181
|
return rules;
|
|
123
182
|
}
|
|
@@ -125,25 +184,18 @@ async function loadWorkspaceRules(directory, tsConfigPath) {
|
|
|
125
184
|
console.error(err);
|
|
126
185
|
return {};
|
|
127
186
|
}
|
|
128
|
-
finally {
|
|
129
|
-
if (registrationCleanup) {
|
|
130
|
-
registrationCleanup();
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
187
|
}
|
|
134
188
|
exports.workspaceRules = (() => {
|
|
135
189
|
// If `tools/eslint-rules` folder doesn't exist, there is no point trying to register and load it
|
|
136
190
|
if (!(0, fs_1.existsSync)(constants_1.WORKSPACE_PLUGIN_DIR)) {
|
|
137
191
|
return {};
|
|
138
192
|
}
|
|
139
|
-
// Register `tools/eslint-rules` for TS transpilation
|
|
140
|
-
const registrationCleanup = (0, internal_1.registerTsProject)((0, path_1.join)(constants_1.WORKSPACE_PLUGIN_DIR, 'tsconfig.json'));
|
|
141
193
|
try {
|
|
142
194
|
/**
|
|
143
195
|
* Currently we only support applying the rules from the user's workspace plugin object
|
|
144
196
|
* (i.e. not other things that plugings can expose like configs, processors etc)
|
|
145
197
|
*/
|
|
146
|
-
const { rules } =
|
|
198
|
+
const { rules } = (0, internal_2.loadTsFile)(constants_1.WORKSPACE_PLUGIN_DIR, (0, path_1.join)(constants_1.WORKSPACE_PLUGIN_DIR, 'tsconfig.json'));
|
|
147
199
|
// Apply the namespace to the resolved rules
|
|
148
200
|
const namespacedRules = {};
|
|
149
201
|
for (const [ruleName, ruleConfig] of Object.entries(rules)) {
|
|
@@ -157,9 +209,4 @@ exports.workspaceRules = (() => {
|
|
|
157
209
|
console.error(err);
|
|
158
210
|
return {};
|
|
159
211
|
}
|
|
160
|
-
finally {
|
|
161
|
-
if (registrationCleanup) {
|
|
162
|
-
registrationCleanup();
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
212
|
})();
|
|
@@ -15,6 +15,7 @@ export type Options = [
|
|
|
15
15
|
];
|
|
16
16
|
export type MessageIds = 'missingDependency' | 'obsoleteDependency' | 'versionMismatch' | 'missingDependencySection' | 'invalidCatalogReference';
|
|
17
17
|
export declare const RULE_NAME = "dependency-checks";
|
|
18
|
-
declare const _default: ESLintUtils.RuleModule<MessageIds, Options, unknown, ESLintUtils.RuleListener
|
|
18
|
+
declare const _default: ESLintUtils.RuleModule<MessageIds, Options, unknown, ESLintUtils.RuleListener> & {
|
|
19
|
+
name: string;
|
|
20
|
+
};
|
|
19
21
|
export default _default;
|
|
20
|
-
//# sourceMappingURL=dependency-checks.d.ts.map
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.RULE_NAME = void 0;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
const
|
|
6
|
-
const
|
|
5
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
6
|
+
const internal_2 = require("@nx/js/internal");
|
|
7
7
|
const utils_1 = require("@typescript-eslint/utils");
|
|
8
8
|
const path_1 = require("path");
|
|
9
9
|
const semver_1 = require("semver");
|
|
@@ -89,7 +89,7 @@ exports.default = utils_1.ESLintUtils.RuleCreator(() => `https://github.com/nrwl
|
|
|
89
89
|
return {};
|
|
90
90
|
}
|
|
91
91
|
const rootPackageJson = (0, package_json_utils_1.getPackageJson)((0, path_1.join)(devkit_1.workspaceRoot, 'package.json'));
|
|
92
|
-
const npmDependencies = (0,
|
|
92
|
+
const npmDependencies = (0, internal_2.findNpmDependencies)(devkit_1.workspaceRoot, sourceProject, projectGraph, projectFileMap, buildTarget, // TODO: What if child library has a build target different from the parent?
|
|
93
93
|
{
|
|
94
94
|
includeTransitiveDependencies,
|
|
95
95
|
ignoredFiles,
|
|
@@ -97,10 +97,21 @@ exports.default = utils_1.ESLintUtils.RuleCreator(() => `https://github.com/nrwl
|
|
|
97
97
|
runtimeHelpers,
|
|
98
98
|
});
|
|
99
99
|
const expectedDependencyNames = Object.keys(npmDependencies);
|
|
100
|
+
// Packages eligible for `workspace:*` rewrites under
|
|
101
|
+
// `peerDepsVersionStrategy: 'workspace'`. Must be both a workspace project
|
|
102
|
+
// and registered in the package manager's workspaces — otherwise
|
|
103
|
+
// `workspace:*` won't resolve at install time.
|
|
104
|
+
const workspacePackageNames = new Set();
|
|
105
|
+
for (const node of Object.values(projectGraph.nodes)) {
|
|
106
|
+
const js = node.data?.metadata?.js;
|
|
107
|
+
if (js?.packageName && js.isInPackageManagerWorkspaces) {
|
|
108
|
+
workspacePackageNames.add(js.packageName);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
100
111
|
const packageJson = JSON.parse(context.sourceCode.getText());
|
|
101
112
|
const projPackageJsonDeps = (0, package_json_utils_1.getProductionDependencies)(packageJson);
|
|
102
113
|
const rootPackageJsonDeps = (0, package_json_utils_1.getAllDependencies)(rootPackageJson);
|
|
103
|
-
const catalogManager = (0,
|
|
114
|
+
const catalogManager = (0, internal_1.getCatalogManager)(devkit_1.workspaceRoot);
|
|
104
115
|
const catalogDefs = catalogManager?.getCatalogDefinitions(devkit_1.workspaceRoot);
|
|
105
116
|
function catalogEntryMatchesInstalled(catalogVersionSpec, installedVersion) {
|
|
106
117
|
if (installedVersion === '*') {
|
|
@@ -189,7 +200,8 @@ exports.default = utils_1.ESLintUtils.RuleCreator(() => `https://github.com/nrwl
|
|
|
189
200
|
fix(fixer) {
|
|
190
201
|
missingDeps.forEach((d) => {
|
|
191
202
|
if (dependencySection === 'peerDependencies' &&
|
|
192
|
-
peerDepsVersionStrategy === 'workspace'
|
|
203
|
+
peerDepsVersionStrategy === 'workspace' &&
|
|
204
|
+
workspacePackageNames.has(d)) {
|
|
193
205
|
projPackageJsonDeps[d] = WORKSPACE_VERSION_WILDCARD;
|
|
194
206
|
}
|
|
195
207
|
else {
|
|
@@ -237,7 +249,8 @@ exports.default = utils_1.ESLintUtils.RuleCreator(() => `https://github.com/nrwl
|
|
|
237
249
|
const dependencySection = getDependencySection(node);
|
|
238
250
|
if (dependencySection === 'peerDependencies' &&
|
|
239
251
|
peerDepsVersionStrategy === 'workspace' &&
|
|
240
|
-
!packageRange.startsWith('workspace:')
|
|
252
|
+
!packageRange.startsWith('workspace:') &&
|
|
253
|
+
workspacePackageNames.has(packageName)) {
|
|
241
254
|
context.report({
|
|
242
255
|
node: node,
|
|
243
256
|
messageId: 'versionMismatch',
|
|
@@ -15,6 +15,7 @@ export type Options = [
|
|
|
15
15
|
];
|
|
16
16
|
export type MessageIds = 'noRelativeOrAbsoluteImportsAcrossLibraries' | 'noRelativeOrAbsoluteExternals' | 'noSelfCircularDependencies' | 'noCircularDependencies' | 'noImportsOfApps' | 'noImportsOfE2e' | 'noImportOfNonBuildableLibraries' | 'noImportsOfLazyLoadedLibraries' | 'projectWithoutTagsCannotHaveDependencies' | 'bannedExternalImportsViolation' | 'nestedBannedExternalImportsViolation' | 'noTransitiveDependencies' | 'onlyTagsConstraintViolation' | 'emptyOnlyTagsConstraintViolation' | 'notTagsConstraintViolation';
|
|
17
17
|
export declare const RULE_NAME = "enforce-module-boundaries";
|
|
18
|
-
declare const _default: ESLintUtils.RuleModule<MessageIds, Options, unknown, ESLintUtils.RuleListener
|
|
18
|
+
declare const _default: ESLintUtils.RuleModule<MessageIds, Options, unknown, ESLintUtils.RuleListener> & {
|
|
19
|
+
name: string;
|
|
20
|
+
};
|
|
19
21
|
export default _default;
|
|
20
|
-
//# sourceMappingURL=enforce-module-boundaries.d.ts.map
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.RULE_NAME = void 0;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
5
|
const utils_1 = require("@typescript-eslint/utils");
|
|
6
|
-
const internal_1 = require("@nx/js/
|
|
6
|
+
const internal_1 = require("@nx/js/internal");
|
|
7
7
|
const fileutils_1 = require("nx/src/utils/fileutils");
|
|
8
8
|
const path_1 = require("path");
|
|
9
9
|
const ast_utils_1 = require("../utils/ast-utils");
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { TSESLint } from '@typescript-eslint/utils';
|
|
2
2
|
import type { AST } from 'jsonc-eslint-parser';
|
|
3
|
+
import { ProjectConfiguration } from '@nx/devkit';
|
|
3
4
|
export type Options = [
|
|
4
5
|
{
|
|
5
6
|
generatorsJson?: string;
|
|
@@ -10,19 +11,17 @@ export type Options = [
|
|
|
10
11
|
tsConfig?: string;
|
|
11
12
|
}
|
|
12
13
|
];
|
|
13
|
-
type
|
|
14
|
-
rootDir?: string;
|
|
15
|
-
outDir?: string;
|
|
16
|
-
};
|
|
17
|
-
export type MessageIds = 'missingRequiredSchema' | 'invalidSchemaPath' | 'missingImplementation' | 'invalidImplementationPath' | 'invalidImplementationModule' | 'unableToReadImplementationExports' | 'invalidVersion' | 'missingVersion' | 'noGeneratorsOrSchematicsFound' | 'noExecutorsOrBuildersFound' | 'valueShouldBeObject';
|
|
14
|
+
export type MessageIds = 'missingRequiredSchema' | 'invalidSchemaPath' | 'missingImplementation' | 'invalidImplementationPath' | 'invalidImplementationModule' | 'unableToReadImplementationExports' | 'invalidPromptPath' | 'invalidVersion' | 'missingVersion' | 'noGeneratorsOrSchematicsFound' | 'noExecutorsOrBuildersFound' | 'valueShouldBeObject';
|
|
18
15
|
export declare const RULE_NAME = "nx-plugin-checks";
|
|
19
|
-
declare const _default: TSESLint.RuleModule<MessageIds, Options, unknown, TSESLint.RuleListener
|
|
16
|
+
declare const _default: TSESLint.RuleModule<MessageIds, Options, unknown, TSESLint.RuleListener> & {
|
|
17
|
+
name: string;
|
|
18
|
+
};
|
|
20
19
|
export default _default;
|
|
21
|
-
export declare function checkCollectionFileNode(baseNode: AST.JSONObjectExpression, mode: 'migration' | 'generator' | 'executor', context: TSESLint.RuleContext<MessageIds, Options>,
|
|
22
|
-
export declare function checkCollectionNode(baseNode: AST.JSONObjectExpression, mode: 'migration' | 'generator' | 'executor', context: TSESLint.RuleContext<MessageIds, Options>,
|
|
23
|
-
export declare function validateEntry(baseNode: AST.JSONObjectExpression, key: string, mode: 'migration' | 'generator' | 'executor', context: TSESLint.RuleContext<MessageIds, Options>,
|
|
24
|
-
export declare function validateImplementationNode(implementationNode: AST.JSONProperty, key: string, context: TSESLint.RuleContext<MessageIds, Options>,
|
|
20
|
+
export declare function checkCollectionFileNode(baseNode: AST.JSONObjectExpression, mode: 'migration' | 'generator' | 'executor', context: TSESLint.RuleContext<MessageIds, Options>, projects: Record<string, ProjectConfiguration>): void;
|
|
21
|
+
export declare function checkCollectionNode(baseNode: AST.JSONObjectExpression, mode: 'migration' | 'generator' | 'executor', context: TSESLint.RuleContext<MessageIds, Options>, projects: Record<string, ProjectConfiguration>): void;
|
|
22
|
+
export declare function validateEntry(baseNode: AST.JSONObjectExpression, key: string, mode: 'migration' | 'generator' | 'executor', context: TSESLint.RuleContext<MessageIds, Options>, projects: Record<string, ProjectConfiguration>): void;
|
|
23
|
+
export declare function validateImplementationNode(implementationNode: AST.JSONProperty, key: string, context: TSESLint.RuleContext<MessageIds, Options>, projects: Record<string, ProjectConfiguration>): void;
|
|
24
|
+
export declare function validatePromptNode(promptNode: AST.JSONProperty, key: string, context: TSESLint.RuleContext<MessageIds, Options>): void;
|
|
25
25
|
export declare function validatePackageGroup(baseNode: AST.JSONObjectExpression, context: TSESLint.RuleContext<MessageIds, Options>): void;
|
|
26
26
|
export declare function validateVersionJsonExpression(node: AST.JSONExpression, context: TSESLint.RuleContext<MessageIds, Options>): string | boolean;
|
|
27
27
|
export declare function checkIfIdentifierIsFunction(filePath: string, identifier: string): boolean;
|
|
28
|
-
//# sourceMappingURL=nx-plugin-checks.d.ts.map
|