@nx/eslint-plugin 24.0.0-beta.2 → 24.0.0-beta.3
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.
|
@@ -146,23 +146,23 @@ exports.default = utils_1.ESLintUtils.RuleCreator(() => `https://github.com/nrwl
|
|
|
146
146
|
}
|
|
147
147
|
const workspaceLayout = global.workspaceLayout;
|
|
148
148
|
const expandedIgnoreCircularDependencies = (0, graph_utils_1.expandIgnoredCircularDependencies)(ignoredCircularDependencies, projectGraph);
|
|
149
|
-
let
|
|
150
|
-
// Atomized e2e specs (`<target>--<spec path>`) with
|
|
151
|
-
// `// @nx-
|
|
149
|
+
let ignoreServerInputsSpec;
|
|
150
|
+
// Atomized e2e specs (`<target>--<spec path>`) with
|
|
151
|
+
// `// @nx-ignore-server-inputs` import app code with bare imports
|
|
152
152
|
// (`import 'app/feature'`) to hash from it.
|
|
153
|
-
function
|
|
153
|
+
function isIgnoreServerInputsImport(node, sourceProject, sourceFilePath) {
|
|
154
154
|
if (node.type !== utils_1.AST_NODE_TYPES.ImportDeclaration ||
|
|
155
155
|
context.sourceCode.getFirstToken(node, 1).range[0] !==
|
|
156
156
|
node.source.range[0]) {
|
|
157
157
|
return false;
|
|
158
158
|
}
|
|
159
|
-
if (
|
|
159
|
+
if (ignoreServerInputsSpec === undefined) {
|
|
160
160
|
const specPath = (0, devkit_1.normalizePath)((0, path_1.relative)(sourceProject.data.root, sourceFilePath));
|
|
161
|
-
|
|
162
|
-
(0, internal_2.
|
|
161
|
+
ignoreServerInputsSpec =
|
|
162
|
+
(0, internal_2.hasIgnoreServerInputsDirective)(context.sourceCode.text) &&
|
|
163
163
|
Object.keys(sourceProject.data.targets ?? {}).some((targetName) => targetName.endsWith(`--${specPath}`));
|
|
164
164
|
}
|
|
165
|
-
return
|
|
165
|
+
return ignoreServerInputsSpec;
|
|
166
166
|
}
|
|
167
167
|
function run(imp, node) {
|
|
168
168
|
// whitelisted import
|
|
@@ -186,7 +186,7 @@ exports.default = utils_1.ESLintUtils.RuleCreator(() => `https://github.com/nrwl
|
|
|
186
186
|
}
|
|
187
187
|
if (((targetProject && sourceProject !== targetProject) ||
|
|
188
188
|
isAbsoluteImportIntoAnotherProj) &&
|
|
189
|
-
!
|
|
189
|
+
!isIgnoreServerInputsImport(node, sourceProject, sourceFilePath)) {
|
|
190
190
|
context.report({
|
|
191
191
|
node,
|
|
192
192
|
messageId: 'noRelativeOrAbsoluteImportsAcrossLibraries',
|
|
@@ -395,7 +395,7 @@ exports.default = utils_1.ESLintUtils.RuleCreator(() => `https://github.com/nrwl
|
|
|
395
395
|
// cannot import apps
|
|
396
396
|
if (targetProject.type === 'app' &&
|
|
397
397
|
!(0, runtime_lint_utils_1.appIsMFERemote)(targetProject) &&
|
|
398
|
-
!
|
|
398
|
+
!isIgnoreServerInputsImport(node, sourceProject, sourceFilePath)) {
|
|
399
399
|
context.report({
|
|
400
400
|
node,
|
|
401
401
|
messageId: 'noImportsOfApps',
|
|
@@ -428,7 +428,7 @@ exports.default = utils_1.ESLintUtils.RuleCreator(() => `https://github.com/nrwl
|
|
|
428
428
|
if (node.type !== utils_1.AST_NODE_TYPES.CallExpression &&
|
|
429
429
|
!checkDynamicDependenciesExceptions.some((a) => (0, runtime_lint_utils_1.matchImportWithWildcard)(a, imp)) &&
|
|
430
430
|
(0, runtime_lint_utils_1.hasStaticImportOfDynamicResource)(node, projectGraph, sourceProject.name, targetProject.name, imp, sourceFilePath) &&
|
|
431
|
-
!
|
|
431
|
+
!isIgnoreServerInputsImport(node, sourceProject, sourceFilePath)) {
|
|
432
432
|
const filesWithLazyImports = (0, graph_utils_1.findFilesWithDynamicImports)(projectFileMap, sourceProject.name, targetProject.name);
|
|
433
433
|
context.report({
|
|
434
434
|
data: {
|
|
@@ -444,7 +444,7 @@ exports.default = utils_1.ESLintUtils.RuleCreator(() => `https://github.com/nrwl
|
|
|
444
444
|
}
|
|
445
445
|
// check that dependency constraints are satisfied
|
|
446
446
|
if (depConstraints.length > 0 &&
|
|
447
|
-
!
|
|
447
|
+
!isIgnoreServerInputsImport(node, sourceProject, sourceFilePath)) {
|
|
448
448
|
const constraints = (0, runtime_lint_utils_1.findConstraintsFor)(depConstraints, sourceProject);
|
|
449
449
|
// when no constrains found => error. Force the user to provision them.
|
|
450
450
|
if (constraints.length === 0) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/eslint-plugin",
|
|
3
|
-
"version": "24.0.0-beta.
|
|
3
|
+
"version": "24.0.0-beta.3",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"files": [
|
|
@@ -100,8 +100,8 @@
|
|
|
100
100
|
}
|
|
101
101
|
},
|
|
102
102
|
"dependencies": {
|
|
103
|
-
"@nx/devkit": "24.0.0-beta.
|
|
104
|
-
"@nx/js": "24.0.0-beta.
|
|
103
|
+
"@nx/devkit": "24.0.0-beta.3",
|
|
104
|
+
"@nx/js": "24.0.0-beta.3",
|
|
105
105
|
"@phenomnomnominal/tsquery": "~6.2.0",
|
|
106
106
|
"@typescript-eslint/type-utils": "^8.0.0",
|
|
107
107
|
"@typescript-eslint/utils": "^8.0.0",
|
|
@@ -113,7 +113,7 @@
|
|
|
113
113
|
"tslib": "^2.3.0"
|
|
114
114
|
},
|
|
115
115
|
"devDependencies": {
|
|
116
|
-
"nx": "24.0.0-beta.
|
|
116
|
+
"nx": "24.0.0-beta.3"
|
|
117
117
|
},
|
|
118
118
|
"publishConfig": {
|
|
119
119
|
"access": "public"
|