@nx/eslint 0.0.0-pr-27404-00130f5 → 0.0.0-pr-27404-9b7456c
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/eslint",
|
|
3
|
-
"version": "0.0.0-pr-27404-
|
|
3
|
+
"version": "0.0.0-pr-27404-9b7456c",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "The ESLint plugin for Nx contains executors, generators and utilities used for linting JavaScript/TypeScript projects within an Nx workspace.",
|
|
6
6
|
"repository": {
|
|
@@ -35,12 +35,12 @@
|
|
|
35
35
|
"eslint": "^8.0.0 || ^9.0.0"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@nx/devkit": "0.0.0-pr-27404-
|
|
39
|
-
"@nx/js": "0.0.0-pr-27404-
|
|
38
|
+
"@nx/devkit": "0.0.0-pr-27404-9b7456c",
|
|
39
|
+
"@nx/js": "0.0.0-pr-27404-9b7456c",
|
|
40
40
|
"semver": "^7.5.3",
|
|
41
41
|
"tslib": "^2.3.0",
|
|
42
42
|
"typescript": "~5.4.2",
|
|
43
|
-
"@nx/linter": "0.0.0-pr-27404-
|
|
43
|
+
"@nx/linter": "0.0.0-pr-27404-9b7456c"
|
|
44
44
|
},
|
|
45
45
|
"peerDependenciesMeta": {
|
|
46
46
|
"@zkochan/js-yaml": {
|
|
@@ -86,7 +86,25 @@ const getGlobalFlatEslintConfiguration = (rootProject) => {
|
|
|
86
86
|
content = (0, ast_utils_1.addBlockToFlatConfigExport)(content, (0, ast_utils_1.generateFlatPredefinedConfig)('flat/typescript'));
|
|
87
87
|
content = (0, ast_utils_1.addBlockToFlatConfigExport)(content, (0, ast_utils_1.generateFlatPredefinedConfig)('flat/javascript'));
|
|
88
88
|
if (!rootProject) {
|
|
89
|
-
content = (0, ast_utils_1.addBlockToFlatConfigExport)(content, (0, ast_utils_1.generateFlatOverride)(
|
|
89
|
+
content = (0, ast_utils_1.addBlockToFlatConfigExport)(content, (0, ast_utils_1.generateFlatOverride)({
|
|
90
|
+
files: ['*.ts', '*.tsx', '*.js', '*.jsx'],
|
|
91
|
+
rules: {
|
|
92
|
+
'@nx/enforce-module-boundaries': [
|
|
93
|
+
'error',
|
|
94
|
+
{
|
|
95
|
+
enforceBuildableLibDependency: true,
|
|
96
|
+
allow: [
|
|
97
|
+
// This allows a root project to be present without causing lint errors
|
|
98
|
+
// since all projects will depend on this base file.
|
|
99
|
+
'^.*/eslint.base.config.[cm]?js$',
|
|
100
|
+
],
|
|
101
|
+
depConstraints: [
|
|
102
|
+
{ sourceTag: '*', onlyDependOnLibsWithTags: ['*'] },
|
|
103
|
+
],
|
|
104
|
+
},
|
|
105
|
+
],
|
|
106
|
+
},
|
|
107
|
+
}));
|
|
90
108
|
}
|
|
91
109
|
content = (0, ast_utils_1.addBlockToFlatConfigExport)(content, (0, ast_utils_1.generateFlatOverride)({
|
|
92
110
|
files: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx'],
|
|
@@ -164,7 +164,7 @@ function createEsLintConfiguration(tree, options, projectConfig, setParserOption
|
|
|
164
164
|
'error',
|
|
165
165
|
{
|
|
166
166
|
// With flat configs, we don't want to include imports in the eslint js/cjs/mjs files to be checked
|
|
167
|
-
ignoredFiles: ['
|
|
167
|
+
ignoredFiles: ['{projectRoot}/eslint.config.{js,cjs,mjs}'],
|
|
168
168
|
},
|
|
169
169
|
],
|
|
170
170
|
},
|
|
@@ -277,6 +277,11 @@ function addBlockToFlatConfigExport(content, config, options = {
|
|
|
277
277
|
return node.expression.right.elements;
|
|
278
278
|
}
|
|
279
279
|
});
|
|
280
|
+
// The config is not in the format that we generate with, skip update.
|
|
281
|
+
// This could happen during `init-migration` when extracting config from the base, but
|
|
282
|
+
// base config was not generated by Nx.
|
|
283
|
+
if (!exportsArray)
|
|
284
|
+
return content;
|
|
280
285
|
const insert = printer.printNode(ts.EmitHint.Expression, config, source);
|
|
281
286
|
if (options.insertAtTheEnd) {
|
|
282
287
|
const index = exportsArray.length > 0
|
|
@@ -414,7 +419,7 @@ function removePlugin(content, pluginName, pluginImport) {
|
|
|
414
419
|
function removeCompatExtends(content, compatExtends) {
|
|
415
420
|
const source = ts.createSourceFile('', content, ts.ScriptTarget.Latest, true, ts.ScriptKind.JS);
|
|
416
421
|
const changes = [];
|
|
417
|
-
findAllBlocks(source)
|
|
422
|
+
findAllBlocks(source)?.forEach((node) => {
|
|
418
423
|
if (ts.isSpreadElement(node) &&
|
|
419
424
|
ts.isCallExpression(node.expression) &&
|
|
420
425
|
ts.isArrowFunction(node.expression.arguments[0]) &&
|
|
@@ -450,7 +455,7 @@ function removePredefinedConfigs(content, moduleImport, moduleVariable, configs)
|
|
|
450
455
|
const source = ts.createSourceFile('', content, ts.ScriptTarget.Latest, true, ts.ScriptKind.JS);
|
|
451
456
|
const changes = [];
|
|
452
457
|
let removeImport = true;
|
|
453
|
-
findAllBlocks(source)
|
|
458
|
+
findAllBlocks(source)?.forEach((node) => {
|
|
454
459
|
if (ts.isSpreadElement(node) &&
|
|
455
460
|
ts.isElementAccessExpression(node.expression) &&
|
|
456
461
|
ts.isPropertyAccessExpression(node.expression.expression) &&
|