@nrwl/eslint-plugin-nx 13.5.3 → 13.7.0
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 +11 -6
- package/src/configs/typescript.d.ts +0 -5
- package/src/configs/typescript.js +0 -5
- package/src/configs/typescript.js.map +1 -1
- package/src/resolve-workspace-rules.js +11 -5
- package/src/resolve-workspace-rules.js.map +1 -1
- package/src/rules/enforce-module-boundaries.d.ts +1 -1
- package/src/utils/create-eslint-rule.d.ts +2 -14
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nrwl/eslint-plugin-nx",
|
|
3
|
-
"version": "13.
|
|
3
|
+
"version": "13.7.0",
|
|
4
4
|
"description": "ESLint Plugin for Nx",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -23,16 +23,21 @@
|
|
|
23
23
|
},
|
|
24
24
|
"homepage": "https://nx.dev",
|
|
25
25
|
"peerDependencies": {
|
|
26
|
-
"@typescript-eslint/parser": "~5.
|
|
26
|
+
"@typescript-eslint/parser": "~5.10.0",
|
|
27
27
|
"eslint-config-prettier": "^8.1.0"
|
|
28
28
|
},
|
|
29
|
+
"peerDependenciesMeta": {
|
|
30
|
+
"eslint-config-prettier": {
|
|
31
|
+
"optional": true
|
|
32
|
+
}
|
|
33
|
+
},
|
|
29
34
|
"dependencies": {
|
|
30
|
-
"@nrwl/devkit": "13.
|
|
31
|
-
"@nrwl/workspace": "13.
|
|
32
|
-
"@
|
|
35
|
+
"@nrwl/devkit": "13.7.0",
|
|
36
|
+
"@nrwl/workspace": "13.7.0",
|
|
37
|
+
"@swc-node/register": "^1.4.2",
|
|
38
|
+
"@typescript-eslint/experimental-utils": "~5.10.0",
|
|
33
39
|
"chalk": "4.1.0",
|
|
34
40
|
"confusing-browser-globals": "^1.0.9",
|
|
35
|
-
"ts-node": "^9.1.1",
|
|
36
41
|
"tsconfig-paths": "^3.9.0"
|
|
37
42
|
}
|
|
38
43
|
}
|
|
@@ -20,10 +20,5 @@ declare const _default: {
|
|
|
20
20
|
*
|
|
21
21
|
* It should therefore NOT contain any rules or plugins which are specific
|
|
22
22
|
* to one ecosystem, such as React, Angular, Node etc.
|
|
23
|
-
*
|
|
24
|
-
* NOTE: Currently the one exception to this is that there is an override for .tsx
|
|
25
|
-
* for the @typescript-eslint/no-unused-vars rule for backwards compatibility
|
|
26
|
-
* with the original root Nx ESlint config. This will be split out into a dedicated
|
|
27
|
-
* tsx configuration in a follow up PR which handles overrides.
|
|
28
23
|
*/
|
|
29
24
|
export default _default;
|
|
@@ -7,11 +7,6 @@ const app_root_1 = require("@nrwl/tao/src/utils/app-root");
|
|
|
7
7
|
*
|
|
8
8
|
* It should therefore NOT contain any rules or plugins which are specific
|
|
9
9
|
* to one ecosystem, such as React, Angular, Node etc.
|
|
10
|
-
*
|
|
11
|
-
* NOTE: Currently the one exception to this is that there is an override for .tsx
|
|
12
|
-
* for the @typescript-eslint/no-unused-vars rule for backwards compatibility
|
|
13
|
-
* with the original root Nx ESlint config. This will be split out into a dedicated
|
|
14
|
-
* tsx configuration in a follow up PR which handles overrides.
|
|
15
10
|
*/
|
|
16
11
|
exports.default = {
|
|
17
12
|
parser: '@typescript-eslint/parser',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typescript.js","sourceRoot":"","sources":["../../../../../packages/eslint-plugin-nx/src/configs/typescript.ts"],"names":[],"mappings":";;AAAA,2DAA2D;AAE3D
|
|
1
|
+
{"version":3,"file":"typescript.js","sourceRoot":"","sources":["../../../../../packages/eslint-plugin-nx/src/configs/typescript.ts"],"names":[],"mappings":";;AAAA,2DAA2D;AAE3D;;;;;;GAMG;AACH,kBAAe;IACb,MAAM,EAAE,2BAA2B;IACnC,aAAa,EAAE;QACb,WAAW,EAAE,IAAI;QACjB,UAAU,EAAE,QAAQ;QACpB,eAAe,EAAE,sBAAW;KAC7B;IACD,OAAO,EAAE,CAAC,oBAAoB,CAAC;IAC/B,OAAO,EAAE;QACP,oBAAoB;QACpB,8CAA8C;QAC9C,uCAAuC;QACvC,UAAU;KACX;IACD,KAAK,EAAE;QACL,kDAAkD,EAAE,KAAK;QACzD,mDAAmD,EAAE,KAAK;QAC1D,kDAAkD,EAAE,KAAK;QACzD,4CAA4C,EAAE,KAAK;KACpD;CACF,CAAC"}
|
|
@@ -2,7 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.workspaceRules = void 0;
|
|
4
4
|
const fs_1 = require("fs");
|
|
5
|
+
const path_1 = require("path");
|
|
5
6
|
const constants_1 = require("./constants");
|
|
7
|
+
const read_default_tsconfig_1 = require("@swc-node/register/read-default-tsconfig");
|
|
8
|
+
const register_1 = require("@swc-node/register/register");
|
|
6
9
|
/**
|
|
7
10
|
* Optionally, if ts-node and tsconfig-paths are available in the current workspace, apply the require
|
|
8
11
|
* register hooks so that .ts files can be used for writing workspace lint rules.
|
|
@@ -13,9 +16,7 @@ const constants_1 = require("./constants");
|
|
|
13
16
|
*/
|
|
14
17
|
function registerTSWorkspaceLint() {
|
|
15
18
|
try {
|
|
16
|
-
|
|
17
|
-
dir: constants_1.WORKSPACE_PLUGIN_DIR,
|
|
18
|
-
});
|
|
19
|
+
(0, register_1.register)((0, read_default_tsconfig_1.readDefaultTsConfig)((0, path_1.join)(constants_1.WORKSPACE_PLUGIN_DIR, 'tsconfig.json')));
|
|
19
20
|
const tsconfigPaths = require('tsconfig-paths');
|
|
20
21
|
// Load the tsconfig from tools/eslint-rules/tsconfig.json
|
|
21
22
|
const tsConfigResult = tsconfigPaths.loadConfig(constants_1.WORKSPACE_PLUGIN_DIR);
|
|
@@ -23,7 +24,7 @@ function registerTSWorkspaceLint() {
|
|
|
23
24
|
* Register the custom workspace path mappings with node so that workspace libraries
|
|
24
25
|
* can be imported and used within custom workspace lint rules.
|
|
25
26
|
*/
|
|
26
|
-
tsconfigPaths.register({
|
|
27
|
+
return tsconfigPaths.register({
|
|
27
28
|
baseUrl: tsConfigResult.absoluteBaseUrl,
|
|
28
29
|
paths: tsConfigResult.paths,
|
|
29
30
|
});
|
|
@@ -36,7 +37,7 @@ exports.workspaceRules = (() => {
|
|
|
36
37
|
return {};
|
|
37
38
|
}
|
|
38
39
|
// Register `tools/eslint-rules` for TS transpilation
|
|
39
|
-
registerTSWorkspaceLint();
|
|
40
|
+
const registrationCleanup = registerTSWorkspaceLint();
|
|
40
41
|
try {
|
|
41
42
|
/**
|
|
42
43
|
* Currently we only support applying the rules from the user's workspace plugin object
|
|
@@ -53,5 +54,10 @@ exports.workspaceRules = (() => {
|
|
|
53
54
|
catch (err) {
|
|
54
55
|
return {};
|
|
55
56
|
}
|
|
57
|
+
finally {
|
|
58
|
+
if (registrationCleanup) {
|
|
59
|
+
registrationCleanup();
|
|
60
|
+
}
|
|
61
|
+
}
|
|
56
62
|
})();
|
|
57
63
|
//# sourceMappingURL=resolve-workspace-rules.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve-workspace-rules.js","sourceRoot":"","sources":["../../../../packages/eslint-plugin-nx/src/resolve-workspace-rules.ts"],"names":[],"mappings":";;;AACA,2BAAgC;AAChC,2CAA6E;
|
|
1
|
+
{"version":3,"file":"resolve-workspace-rules.js","sourceRoot":"","sources":["../../../../packages/eslint-plugin-nx/src/resolve-workspace-rules.ts"],"names":[],"mappings":";;;AACA,2BAAgC;AAChC,+BAA4B;AAC5B,2CAA6E;AAC7E,oFAA+E;AAC/E,0DAAuD;AAIvD;;;;;;;GAOG;AACH,SAAS,uBAAuB;IAC9B,IAAI;QACF,IAAA,mBAAQ,EAAC,IAAA,2CAAmB,EAAC,IAAA,WAAI,EAAC,gCAAoB,EAAE,eAAe,CAAC,CAAC,CAAC,CAAC;QAE3E,MAAM,aAAa,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;QAEhD,0DAA0D;QAC1D,MAAM,cAAc,GAAG,aAAa,CAAC,UAAU,CAAC,gCAAoB,CAAC,CAAC;QAEtE;;;WAGG;QACH,OAAO,aAAa,CAAC,QAAQ,CAAC;YAC5B,OAAO,EAAE,cAAc,CAAC,eAAe;YACvC,KAAK,EAAE,cAAc,CAAC,KAAK;SAC5B,CAAC,CAAC;KACJ;IAAC,OAAO,GAAG,EAAE,GAAE;AAClB,CAAC;AAEY,QAAA,cAAc,GAAG,CAAC,GAAgB,EAAE;IAC/C,iGAAiG;IACjG,IAAI,CAAC,IAAA,eAAU,EAAC,gCAAoB,CAAC,EAAE;QACrC,OAAO,EAAE,CAAC;KACX;IACD,qDAAqD;IACrD,MAAM,mBAAmB,GAAG,uBAAuB,EAAE,CAAC;IACtD,IAAI;QACF;;;WAGG;QACH,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC,gCAAoB,CAAC,CAAC;QAEhD,4CAA4C;QAC5C,MAAM,eAAe,GAAgB,EAAE,CAAC;QACxC,KAAK,MAAM,CAAC,QAAQ,EAAE,UAAU,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAoB,CAAC,EAAE;YACzE,eAAe,CAAC,GAAG,oCAAwB,IAAI,QAAQ,EAAE,CAAC,GAAG,UAAU,CAAC;SACzE;QACD,OAAO,eAAe,CAAC;KACxB;IAAC,OAAO,GAAG,EAAE;QACZ,OAAO,EAAE,CAAC;KACX;YAAS;QACR,IAAI,mBAAmB,EAAE;YACvB,mBAAmB,EAAE,CAAC;SACvB;KACF;AACH,CAAC,CAAC,EAAE,CAAC"}
|
|
@@ -10,5 +10,5 @@ declare type Options = [
|
|
|
10
10
|
];
|
|
11
11
|
export declare type MessageIds = 'noRelativeOrAbsoluteImportsAcrossLibraries' | 'noSelfCircularDependencies' | 'noCircularDependencies' | 'noImportsOfApps' | 'noImportsOfE2e' | 'noImportOfNonBuildableLibraries' | 'noImportsOfLazyLoadedLibraries' | 'projectWithoutTagsCannotHaveDependencies' | 'tagConstraintViolation' | 'bannedExternalImportsViolation' | 'noTransitiveDependencies';
|
|
12
12
|
export declare const RULE_NAME = "enforce-module-boundaries";
|
|
13
|
-
declare const _default: import("@typescript-eslint/
|
|
13
|
+
declare const _default: import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<MessageIds, Options, import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleListener>;
|
|
14
14
|
export default _default;
|
|
@@ -1,14 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
meta: {
|
|
4
|
-
docs: {
|
|
5
|
-
description: string;
|
|
6
|
-
recommended: false | "warn" | "error";
|
|
7
|
-
suggestion?: boolean;
|
|
8
|
-
requiresTypeChecking?: boolean;
|
|
9
|
-
extendsBaseRule?: string | boolean;
|
|
10
|
-
};
|
|
11
|
-
} & Omit<import("@typescript-eslint/experimental-utils/dist/ts-eslint/Rule").RuleMetaData<TMessageIds>, "docs">;
|
|
12
|
-
defaultOptions: Readonly<TOptions>;
|
|
13
|
-
create: (context: Readonly<import("@typescript-eslint/experimental-utils/dist/ts-eslint/Rule").RuleContext<TMessageIds, TOptions>>, optionsWithDefault: Readonly<TOptions>) => TRuleListener;
|
|
14
|
-
}>) => import("@typescript-eslint/experimental-utils/dist/ts-eslint/Rule").RuleModule<TMessageIds, TOptions, TRuleListener>;
|
|
1
|
+
import { ESLintUtils } from '@typescript-eslint/experimental-utils';
|
|
2
|
+
export declare const createESLintRule: <TOptions extends readonly unknown[], TMessageIds extends string, TRuleListener extends import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleListener = import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleListener>({ name, meta, ...rule }: Readonly<ESLintUtils.RuleWithMetaAndName<TOptions, TMessageIds, TRuleListener>>) => import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<TMessageIds, TOptions, TRuleListener>;
|