@nrwl/eslint-plugin-nx 16.0.0-beta.0 → 16.0.0-beta.1
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/index.d.ts +1 -0
- package/index.js +5 -0
- package/index.js.map +1 -0
- package/package.json +8 -18
- package/README.md +0 -63
- package/src/configs/angular-template.d.ts +0 -20
- package/src/configs/angular-template.js +0 -22
- package/src/configs/angular-template.js.map +0 -1
- package/src/configs/angular.d.ts +0 -25
- package/src/configs/angular.js +0 -43
- package/src/configs/angular.js.map +0 -1
- package/src/configs/javascript.d.ts +0 -42
- package/src/configs/javascript.js +0 -51
- package/src/configs/javascript.js.map +0 -1
- package/src/configs/react-base.d.ts +0 -112
- package/src/configs/react-base.js +0 -141
- package/src/configs/react-base.js.map +0 -1
- package/src/configs/react-jsx.d.ts +0 -71
- package/src/configs/react-jsx.js +0 -65
- package/src/configs/react-jsx.js.map +0 -1
- package/src/configs/react-tmp.d.ts +0 -12
- package/src/configs/react-tmp.js +0 -18
- package/src/configs/react-tmp.js.map +0 -1
- package/src/configs/react-typescript.d.ts +0 -41
- package/src/configs/react-typescript.js +0 -56
- package/src/configs/react-typescript.js.map +0 -1
- package/src/configs/typescript.d.ts +0 -24
- package/src/configs/typescript.js +0 -34
- package/src/configs/typescript.js.map +0 -1
- package/src/constants.d.ts +0 -12
- package/src/constants.js +0 -18
- package/src/constants.js.map +0 -1
- package/src/index.d.ts +0 -1
- package/src/index.js +0 -28
- package/src/index.js.map +0 -1
- package/src/resolve-workspace-rules.d.ts +0 -4
- package/src/resolve-workspace-rules.js +0 -36
- package/src/resolve-workspace-rules.js.map +0 -1
- package/src/rules/enforce-module-boundaries.d.ts +0 -16
- package/src/rules/enforce-module-boundaries.js +0 -428
- package/src/rules/enforce-module-boundaries.js.map +0 -1
- package/src/rules/nx-plugin-checks.d.ts +0 -21
- package/src/rules/nx-plugin-checks.js +0 -359
- package/src/rules/nx-plugin-checks.js.map +0 -1
- package/src/utils/ast-utils.d.ts +0 -12
- package/src/utils/ast-utils.js +0 -181
- package/src/utils/ast-utils.js.map +0 -1
- package/src/utils/config-utils.d.ts +0 -6
- package/src/utils/config-utils.js +0 -21
- package/src/utils/config-utils.js.map +0 -1
- package/src/utils/create-eslint-rule.d.ts +0 -2
- package/src/utils/create-eslint-rule.js +0 -6
- package/src/utils/create-eslint-rule.js.map +0 -1
- package/src/utils/graph-utils.d.ts +0 -5
- package/src/utils/graph-utils.js +0 -117
- package/src/utils/graph-utils.js.map +0 -1
- package/src/utils/project-graph-utils.d.ts +0 -7
- package/src/utils/project-graph-utils.js +0 -46
- package/src/utils/project-graph-utils.js.map +0 -1
- package/src/utils/runtime-lint-utils.d.ts +0 -85
- package/src/utils/runtime-lint-utils.js +0 -329
- package/src/utils/runtime-lint-utils.js.map +0 -1
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This configuration is intended to be applied to ONLY files which contain JSX/TSX
|
|
3
|
-
* code.
|
|
4
|
-
*
|
|
5
|
-
* It should therefore NOT contain any rules or plugins which are generic
|
|
6
|
-
* to all file types within variants of React projects.
|
|
7
|
-
*
|
|
8
|
-
* This configuration is intended to be combined with other configs from this
|
|
9
|
-
* package.
|
|
10
|
-
*/
|
|
11
|
-
declare const _default: {
|
|
12
|
-
settings: {
|
|
13
|
-
react: {
|
|
14
|
-
version: string;
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
plugins: string[];
|
|
18
|
-
extends: string[];
|
|
19
|
-
rules: {
|
|
20
|
-
/**
|
|
21
|
-
* React-specific rule configurations
|
|
22
|
-
* https://github.com/yannickcr/eslint-plugin-react
|
|
23
|
-
*/
|
|
24
|
-
'react/forbid-foreign-prop-types': (string | {
|
|
25
|
-
allowInPropTypes: boolean;
|
|
26
|
-
})[];
|
|
27
|
-
'react/jsx-no-comment-textnodes': string;
|
|
28
|
-
'react/jsx-no-duplicate-props': string;
|
|
29
|
-
'react/jsx-no-target-blank': string;
|
|
30
|
-
'react/jsx-no-undef': string;
|
|
31
|
-
'react/jsx-pascal-case': (string | {
|
|
32
|
-
allowAllCaps: boolean;
|
|
33
|
-
ignore: any[];
|
|
34
|
-
})[];
|
|
35
|
-
'react/jsx-uses-vars': string;
|
|
36
|
-
'react/no-danger-with-children': string;
|
|
37
|
-
'react/no-direct-mutation-state': string;
|
|
38
|
-
'react/no-is-mounted': string;
|
|
39
|
-
'react/no-typos': string;
|
|
40
|
-
'react/jsx-uses-react': string;
|
|
41
|
-
'react/react-in-jsx-scope': string;
|
|
42
|
-
'react/require-render-return': string;
|
|
43
|
-
'react/style-prop-object': string;
|
|
44
|
-
'react/jsx-no-useless-fragment': string;
|
|
45
|
-
/**
|
|
46
|
-
* JSX Accessibility rule configurations
|
|
47
|
-
* https://github.com/evcohen/eslint-plugin-jsx-a11y
|
|
48
|
-
*/
|
|
49
|
-
'jsx-a11y/accessible-emoji': string;
|
|
50
|
-
'jsx-a11y/alt-text': string;
|
|
51
|
-
'jsx-a11y/anchor-has-content': string;
|
|
52
|
-
'jsx-a11y/anchor-is-valid': (string | {
|
|
53
|
-
aspects: string[];
|
|
54
|
-
})[];
|
|
55
|
-
'jsx-a11y/aria-activedescendant-has-tabindex': string;
|
|
56
|
-
'jsx-a11y/aria-props': string;
|
|
57
|
-
'jsx-a11y/aria-proptypes': string;
|
|
58
|
-
'jsx-a11y/aria-role': string;
|
|
59
|
-
'jsx-a11y/aria-unsupported-elements': string;
|
|
60
|
-
'jsx-a11y/heading-has-content': string;
|
|
61
|
-
'jsx-a11y/iframe-has-title': string;
|
|
62
|
-
'jsx-a11y/img-redundant-alt': string;
|
|
63
|
-
'jsx-a11y/no-access-key': string;
|
|
64
|
-
'jsx-a11y/no-distracting-elements': string;
|
|
65
|
-
'jsx-a11y/no-redundant-roles': string;
|
|
66
|
-
'jsx-a11y/role-has-required-aria-props': string;
|
|
67
|
-
'jsx-a11y/role-supports-aria-props': string;
|
|
68
|
-
'jsx-a11y/scope': string;
|
|
69
|
-
};
|
|
70
|
-
};
|
|
71
|
-
export default _default;
|
package/src/configs/react-jsx.js
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
/**
|
|
4
|
-
* This configuration is intended to be applied to ONLY files which contain JSX/TSX
|
|
5
|
-
* code.
|
|
6
|
-
*
|
|
7
|
-
* It should therefore NOT contain any rules or plugins which are generic
|
|
8
|
-
* to all file types within variants of React projects.
|
|
9
|
-
*
|
|
10
|
-
* This configuration is intended to be combined with other configs from this
|
|
11
|
-
* package.
|
|
12
|
-
*/
|
|
13
|
-
exports.default = {
|
|
14
|
-
settings: { react: { version: 'detect' } },
|
|
15
|
-
plugins: ['jsx-a11y', 'react'],
|
|
16
|
-
extends: ['plugin:react-hooks/recommended'],
|
|
17
|
-
rules: {
|
|
18
|
-
/**
|
|
19
|
-
* React-specific rule configurations
|
|
20
|
-
* https://github.com/yannickcr/eslint-plugin-react
|
|
21
|
-
*/
|
|
22
|
-
'react/forbid-foreign-prop-types': ['warn', { allowInPropTypes: true }],
|
|
23
|
-
'react/jsx-no-comment-textnodes': 'warn',
|
|
24
|
-
'react/jsx-no-duplicate-props': 'warn',
|
|
25
|
-
'react/jsx-no-target-blank': 'warn',
|
|
26
|
-
'react/jsx-no-undef': 'error',
|
|
27
|
-
'react/jsx-pascal-case': ['warn', { allowAllCaps: true, ignore: [] }],
|
|
28
|
-
'react/jsx-uses-vars': 'warn',
|
|
29
|
-
'react/no-danger-with-children': 'warn',
|
|
30
|
-
'react/no-direct-mutation-state': 'warn',
|
|
31
|
-
'react/no-is-mounted': 'warn',
|
|
32
|
-
'react/no-typos': 'error',
|
|
33
|
-
'react/jsx-uses-react': 'off',
|
|
34
|
-
'react/react-in-jsx-scope': 'off',
|
|
35
|
-
'react/require-render-return': 'error',
|
|
36
|
-
'react/style-prop-object': 'warn',
|
|
37
|
-
'react/jsx-no-useless-fragment': 'warn',
|
|
38
|
-
/**
|
|
39
|
-
* JSX Accessibility rule configurations
|
|
40
|
-
* https://github.com/evcohen/eslint-plugin-jsx-a11y
|
|
41
|
-
*/
|
|
42
|
-
'jsx-a11y/accessible-emoji': 'warn',
|
|
43
|
-
'jsx-a11y/alt-text': 'warn',
|
|
44
|
-
'jsx-a11y/anchor-has-content': 'warn',
|
|
45
|
-
'jsx-a11y/anchor-is-valid': [
|
|
46
|
-
'warn',
|
|
47
|
-
{ aspects: ['noHref', 'invalidHref'] },
|
|
48
|
-
],
|
|
49
|
-
'jsx-a11y/aria-activedescendant-has-tabindex': 'warn',
|
|
50
|
-
'jsx-a11y/aria-props': 'warn',
|
|
51
|
-
'jsx-a11y/aria-proptypes': 'warn',
|
|
52
|
-
'jsx-a11y/aria-role': 'warn',
|
|
53
|
-
'jsx-a11y/aria-unsupported-elements': 'warn',
|
|
54
|
-
'jsx-a11y/heading-has-content': 'warn',
|
|
55
|
-
'jsx-a11y/iframe-has-title': 'warn',
|
|
56
|
-
'jsx-a11y/img-redundant-alt': 'warn',
|
|
57
|
-
'jsx-a11y/no-access-key': 'warn',
|
|
58
|
-
'jsx-a11y/no-distracting-elements': 'warn',
|
|
59
|
-
'jsx-a11y/no-redundant-roles': 'warn',
|
|
60
|
-
'jsx-a11y/role-has-required-aria-props': 'warn',
|
|
61
|
-
'jsx-a11y/role-supports-aria-props': 'warn',
|
|
62
|
-
'jsx-a11y/scope': 'warn',
|
|
63
|
-
},
|
|
64
|
-
};
|
|
65
|
-
//# sourceMappingURL=react-jsx.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"react-jsx.js","sourceRoot":"","sources":["../../../../../packages/eslint-plugin-nx/src/configs/react-jsx.ts"],"names":[],"mappings":";;AAAA;;;;;;;;;GASG;AACH,kBAAe;IACb,QAAQ,EAAE,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE;IAC1C,OAAO,EAAE,CAAC,UAAU,EAAE,OAAO,CAAC;IAC9B,OAAO,EAAE,CAAC,gCAAgC,CAAC;IAC3C,KAAK,EAAE;QACL;;;WAGG;QACH,iCAAiC,EAAE,CAAC,MAAM,EAAE,EAAE,gBAAgB,EAAE,IAAI,EAAE,CAAC;QACvE,gCAAgC,EAAE,MAAM;QACxC,8BAA8B,EAAE,MAAM;QACtC,2BAA2B,EAAE,MAAM;QACnC,oBAAoB,EAAE,OAAO;QAC7B,uBAAuB,EAAE,CAAC,MAAM,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC;QACrE,qBAAqB,EAAE,MAAM;QAC7B,+BAA+B,EAAE,MAAM;QACvC,gCAAgC,EAAE,MAAM;QACxC,qBAAqB,EAAE,MAAM;QAC7B,gBAAgB,EAAE,OAAO;QACzB,sBAAsB,EAAE,KAAK;QAC7B,0BAA0B,EAAE,KAAK;QACjC,6BAA6B,EAAE,OAAO;QACtC,yBAAyB,EAAE,MAAM;QACjC,+BAA+B,EAAE,MAAM;QAEvC;;;WAGG;QACH,2BAA2B,EAAE,MAAM;QACnC,mBAAmB,EAAE,MAAM;QAC3B,6BAA6B,EAAE,MAAM;QACrC,0BAA0B,EAAE;YAC1B,MAAM;YACN,EAAE,OAAO,EAAE,CAAC,QAAQ,EAAE,aAAa,CAAC,EAAE;SACvC;QACD,6CAA6C,EAAE,MAAM;QACrD,qBAAqB,EAAE,MAAM;QAC7B,yBAAyB,EAAE,MAAM;QACjC,oBAAoB,EAAE,MAAM;QAC5B,oCAAoC,EAAE,MAAM;QAC5C,8BAA8B,EAAE,MAAM;QACtC,2BAA2B,EAAE,MAAM;QACnC,4BAA4B,EAAE,MAAM;QACpC,wBAAwB,EAAE,MAAM;QAChC,kCAAkC,EAAE,MAAM;QAC1C,6BAA6B,EAAE,MAAM;QACrC,uCAAuC,EAAE,MAAM;QAC/C,mCAAmC,EAAE,MAAM;QAC3C,gBAAgB,EAAE,MAAM;KACzB;CACF,CAAC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* THIS IS A TEMPORARY CONFIG WHICH MATCHES THE CURRENT BEHAVIOR
|
|
3
|
-
* of including all the rules for all file types within the ESLint
|
|
4
|
-
* config for React projects.
|
|
5
|
-
*
|
|
6
|
-
* It will be refactored in a follow up PR to correctly apply rules
|
|
7
|
-
* to the right file types via overrides.
|
|
8
|
-
*/
|
|
9
|
-
declare const _default: {
|
|
10
|
-
extends: string[];
|
|
11
|
-
};
|
|
12
|
-
export default _default;
|
package/src/configs/react-tmp.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
/**
|
|
4
|
-
* THIS IS A TEMPORARY CONFIG WHICH MATCHES THE CURRENT BEHAVIOR
|
|
5
|
-
* of including all the rules for all file types within the ESLint
|
|
6
|
-
* config for React projects.
|
|
7
|
-
*
|
|
8
|
-
* It will be refactored in a follow up PR to correctly apply rules
|
|
9
|
-
* to the right file types via overrides.
|
|
10
|
-
*/
|
|
11
|
-
exports.default = {
|
|
12
|
-
extends: [
|
|
13
|
-
'plugin:@nrwl/nx/react-base',
|
|
14
|
-
'plugin:@nrwl/nx/react-typescript',
|
|
15
|
-
'plugin:@nrwl/nx/react-jsx',
|
|
16
|
-
],
|
|
17
|
-
};
|
|
18
|
-
//# sourceMappingURL=react-tmp.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"react-tmp.js","sourceRoot":"","sources":["../../../../../packages/eslint-plugin-nx/src/configs/react-tmp.ts"],"names":[],"mappings":";;AAAA;;;;;;;GAOG;AACH,kBAAe;IACb,OAAO,EAAE;QACP,4BAA4B;QAC5B,kCAAkC;QAClC,2BAA2B;KAC5B;CACF,CAAC"}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This configuration is intended to be applied to ONLY .ts and .tsx files within a
|
|
3
|
-
* React project in an Nx workspace.
|
|
4
|
-
*
|
|
5
|
-
* It should therefore NOT contain any rules or plugins which are generic
|
|
6
|
-
* to all variants of React projects, e.g. TypeScript vs JavaScript, .js vs .jsx etc
|
|
7
|
-
*
|
|
8
|
-
* This configuration is intended to be combined with other configs from this
|
|
9
|
-
* package.
|
|
10
|
-
*/
|
|
11
|
-
declare const _default: {
|
|
12
|
-
rules: {
|
|
13
|
-
'default-case': string;
|
|
14
|
-
'no-dupe-class-members': string;
|
|
15
|
-
'no-undef': string;
|
|
16
|
-
'@typescript-eslint/consistent-type-assertions': string;
|
|
17
|
-
'no-array-constructor': string;
|
|
18
|
-
'@typescript-eslint/no-array-constructor': string;
|
|
19
|
-
'@typescript-eslint/no-namespace': string;
|
|
20
|
-
'no-use-before-define': string;
|
|
21
|
-
'@typescript-eslint/no-use-before-define': (string | {
|
|
22
|
-
functions: boolean;
|
|
23
|
-
classes: boolean;
|
|
24
|
-
variables: boolean;
|
|
25
|
-
typedefs: boolean;
|
|
26
|
-
})[];
|
|
27
|
-
'no-unused-vars': string;
|
|
28
|
-
'@typescript-eslint/no-unused-vars': (string | {
|
|
29
|
-
args: string;
|
|
30
|
-
ignoreRestSiblings: boolean;
|
|
31
|
-
})[];
|
|
32
|
-
'no-useless-constructor': string;
|
|
33
|
-
'@typescript-eslint/no-useless-constructor': string;
|
|
34
|
-
'@typescript-eslint/no-unused-expressions': (string | {
|
|
35
|
-
allowShortCircuit: boolean;
|
|
36
|
-
allowTernary: boolean;
|
|
37
|
-
allowTaggedTemplates: boolean;
|
|
38
|
-
})[];
|
|
39
|
-
};
|
|
40
|
-
};
|
|
41
|
-
export default _default;
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
/**
|
|
4
|
-
* This configuration is intended to be applied to ONLY .ts and .tsx files within a
|
|
5
|
-
* React project in an Nx workspace.
|
|
6
|
-
*
|
|
7
|
-
* It should therefore NOT contain any rules or plugins which are generic
|
|
8
|
-
* to all variants of React projects, e.g. TypeScript vs JavaScript, .js vs .jsx etc
|
|
9
|
-
*
|
|
10
|
-
* This configuration is intended to be combined with other configs from this
|
|
11
|
-
* package.
|
|
12
|
-
*/
|
|
13
|
-
exports.default = {
|
|
14
|
-
rules: {
|
|
15
|
-
// TypeScript"s `noFallthroughCasesInSwitch` option is more robust (#6906)
|
|
16
|
-
'default-case': 'off',
|
|
17
|
-
// "tsc" already handles this (https://github.com/typescript-eslint/typescript-eslint/issues/291)
|
|
18
|
-
'no-dupe-class-members': 'off',
|
|
19
|
-
// "tsc" already handles this (https://github.com/typescript-eslint/typescript-eslint/issues/477)
|
|
20
|
-
'no-undef': 'off',
|
|
21
|
-
// Add TypeScript specific rules (and turn off ESLint equivalents)
|
|
22
|
-
'@typescript-eslint/consistent-type-assertions': 'warn',
|
|
23
|
-
'no-array-constructor': 'off',
|
|
24
|
-
'@typescript-eslint/no-array-constructor': 'warn',
|
|
25
|
-
'@typescript-eslint/no-namespace': 'error',
|
|
26
|
-
'no-use-before-define': 'off',
|
|
27
|
-
'@typescript-eslint/no-use-before-define': [
|
|
28
|
-
'warn',
|
|
29
|
-
{
|
|
30
|
-
functions: false,
|
|
31
|
-
classes: false,
|
|
32
|
-
variables: false,
|
|
33
|
-
typedefs: false,
|
|
34
|
-
},
|
|
35
|
-
],
|
|
36
|
-
'no-unused-vars': 'off',
|
|
37
|
-
'@typescript-eslint/no-unused-vars': [
|
|
38
|
-
'warn',
|
|
39
|
-
{
|
|
40
|
-
args: 'none',
|
|
41
|
-
ignoreRestSiblings: true,
|
|
42
|
-
},
|
|
43
|
-
],
|
|
44
|
-
'no-useless-constructor': 'off',
|
|
45
|
-
'@typescript-eslint/no-useless-constructor': 'warn',
|
|
46
|
-
'@typescript-eslint/no-unused-expressions': [
|
|
47
|
-
'error',
|
|
48
|
-
{
|
|
49
|
-
allowShortCircuit: true,
|
|
50
|
-
allowTernary: true,
|
|
51
|
-
allowTaggedTemplates: true,
|
|
52
|
-
},
|
|
53
|
-
],
|
|
54
|
-
},
|
|
55
|
-
};
|
|
56
|
-
//# sourceMappingURL=react-typescript.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"react-typescript.js","sourceRoot":"","sources":["../../../../../packages/eslint-plugin-nx/src/configs/react-typescript.ts"],"names":[],"mappings":";;AAAA;;;;;;;;;GASG;AACH,kBAAe;IACb,KAAK,EAAE;QACL,0EAA0E;QAC1E,cAAc,EAAE,KAAK;QACrB,iGAAiG;QACjG,uBAAuB,EAAE,KAAK;QAC9B,iGAAiG;QACjG,UAAU,EAAE,KAAK;QAEjB,kEAAkE;QAClE,+CAA+C,EAAE,MAAM;QACvD,sBAAsB,EAAE,KAAK;QAC7B,yCAAyC,EAAE,MAAM;QACjD,iCAAiC,EAAE,OAAO;QAC1C,sBAAsB,EAAE,KAAK;QAC7B,yCAAyC,EAAE;YACzC,MAAM;YACN;gBACE,SAAS,EAAE,KAAK;gBAChB,OAAO,EAAE,KAAK;gBACd,SAAS,EAAE,KAAK;gBAChB,QAAQ,EAAE,KAAK;aAChB;SACF;QACD,gBAAgB,EAAE,KAAK;QACvB,mCAAmC,EAAE;YACnC,MAAM;YACN;gBACE,IAAI,EAAE,MAAM;gBACZ,kBAAkB,EAAE,IAAI;aACzB;SACF;QACD,wBAAwB,EAAE,KAAK;QAC/B,2CAA2C,EAAE,MAAM;QACnD,0CAA0C,EAAE;YAC1C,OAAO;YACP;gBACE,iBAAiB,EAAE,IAAI;gBACvB,YAAY,EAAE,IAAI;gBAClB,oBAAoB,EAAE,IAAI;aAC3B;SACF;KACF;CACF,CAAC"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This configuration is intended to be applied to ALL .ts and .tsx files
|
|
3
|
-
* within an Nx workspace.
|
|
4
|
-
*
|
|
5
|
-
* It should therefore NOT contain any rules or plugins which are specific
|
|
6
|
-
* to one ecosystem, such as React, Angular, Node etc.
|
|
7
|
-
*/
|
|
8
|
-
declare const _default: {
|
|
9
|
-
parser: string;
|
|
10
|
-
parserOptions: {
|
|
11
|
-
ecmaVersion: number;
|
|
12
|
-
sourceType: string;
|
|
13
|
-
tsconfigRootDir: string;
|
|
14
|
-
};
|
|
15
|
-
plugins: string[];
|
|
16
|
-
extends: string[];
|
|
17
|
-
rules: {
|
|
18
|
-
'@typescript-eslint/explicit-member-accessibility': string;
|
|
19
|
-
'@typescript-eslint/explicit-module-boundary-types': string;
|
|
20
|
-
'@typescript-eslint/explicit-function-return-type': string;
|
|
21
|
-
'@typescript-eslint/no-parameter-properties': string;
|
|
22
|
-
};
|
|
23
|
-
};
|
|
24
|
-
export default _default;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const devkit_1 = require("@nrwl/devkit");
|
|
4
|
-
const config_utils_1 = require("../utils/config-utils");
|
|
5
|
-
const isPrettierAvailable = (0, config_utils_1.packageExists)('prettier') && (0, config_utils_1.packageExists)('eslint-config-prettier');
|
|
6
|
-
/**
|
|
7
|
-
* This configuration is intended to be applied to ALL .ts and .tsx files
|
|
8
|
-
* within an Nx workspace.
|
|
9
|
-
*
|
|
10
|
-
* It should therefore NOT contain any rules or plugins which are specific
|
|
11
|
-
* to one ecosystem, such as React, Angular, Node etc.
|
|
12
|
-
*/
|
|
13
|
-
exports.default = {
|
|
14
|
-
parser: '@typescript-eslint/parser',
|
|
15
|
-
parserOptions: {
|
|
16
|
-
ecmaVersion: 2020,
|
|
17
|
-
sourceType: 'module',
|
|
18
|
-
tsconfigRootDir: devkit_1.workspaceRoot,
|
|
19
|
-
},
|
|
20
|
-
plugins: ['@typescript-eslint'],
|
|
21
|
-
extends: [
|
|
22
|
-
'eslint:recommended',
|
|
23
|
-
'plugin:@typescript-eslint/eslint-recommended',
|
|
24
|
-
'plugin:@typescript-eslint/recommended',
|
|
25
|
-
...(isPrettierAvailable ? ['prettier'] : []),
|
|
26
|
-
],
|
|
27
|
-
rules: {
|
|
28
|
-
'@typescript-eslint/explicit-member-accessibility': 'off',
|
|
29
|
-
'@typescript-eslint/explicit-module-boundary-types': 'off',
|
|
30
|
-
'@typescript-eslint/explicit-function-return-type': 'off',
|
|
31
|
-
'@typescript-eslint/no-parameter-properties': 'off',
|
|
32
|
-
},
|
|
33
|
-
};
|
|
34
|
-
//# sourceMappingURL=typescript.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"typescript.js","sourceRoot":"","sources":["../../../../../packages/eslint-plugin-nx/src/configs/typescript.ts"],"names":[],"mappings":";;AAAA,yCAA6C;AAC7C,wDAAsD;AAEtD,MAAM,mBAAmB,GACvB,IAAA,4BAAa,EAAC,UAAU,CAAC,IAAI,IAAA,4BAAa,EAAC,wBAAwB,CAAC,CAAC;AAEvE;;;;;;GAMG;AACH,kBAAe;IACb,MAAM,EAAE,2BAA2B;IACnC,aAAa,EAAE;QACb,WAAW,EAAE,IAAI;QACjB,UAAU,EAAE,QAAQ;QACpB,eAAe,EAAE,sBAAa;KAC/B;IACD,OAAO,EAAE,CAAC,oBAAoB,CAAC;IAC/B,OAAO,EAAE;QACP,oBAAoB;QACpB,8CAA8C;QAC9C,uCAAuC;QACvC,GAAG,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;KAC7C;IACD,KAAK,EAAE;QACL,kDAAkD,EAAE,KAAK;QACzD,mDAAmD,EAAE,KAAK;QAC1D,kDAAkD,EAAE,KAAK;QACzD,4CAA4C,EAAE,KAAK;KACpD;CACF,CAAC"}
|
package/src/constants.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export declare const WORKSPACE_PLUGIN_DIR: string;
|
|
2
|
-
/**
|
|
3
|
-
* We add a namespace so that we mitigate the risk of rule name collisions as much as
|
|
4
|
-
* possible between what users might create in their workspaces and what we might want
|
|
5
|
-
* to offer directly in eslint-plugin-nx in the future.
|
|
6
|
-
*
|
|
7
|
-
* E.g. if a user writes a rule called "foo", then they will include it in their ESLint
|
|
8
|
-
* config files as:
|
|
9
|
-
*
|
|
10
|
-
* "@nrwl/nx/workspace/foo": "error"
|
|
11
|
-
*/
|
|
12
|
-
export declare const WORKSPACE_RULE_NAMESPACE = "workspace";
|
package/src/constants.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.WORKSPACE_RULE_NAMESPACE = exports.WORKSPACE_PLUGIN_DIR = void 0;
|
|
4
|
-
const devkit_1 = require("@nrwl/devkit");
|
|
5
|
-
const path_1 = require("path");
|
|
6
|
-
exports.WORKSPACE_PLUGIN_DIR = (0, path_1.join)(devkit_1.workspaceRoot, 'tools/eslint-rules');
|
|
7
|
-
/**
|
|
8
|
-
* We add a namespace so that we mitigate the risk of rule name collisions as much as
|
|
9
|
-
* possible between what users might create in their workspaces and what we might want
|
|
10
|
-
* to offer directly in eslint-plugin-nx in the future.
|
|
11
|
-
*
|
|
12
|
-
* E.g. if a user writes a rule called "foo", then they will include it in their ESLint
|
|
13
|
-
* config files as:
|
|
14
|
-
*
|
|
15
|
-
* "@nrwl/nx/workspace/foo": "error"
|
|
16
|
-
*/
|
|
17
|
-
exports.WORKSPACE_RULE_NAMESPACE = 'workspace';
|
|
18
|
-
//# sourceMappingURL=constants.js.map
|
package/src/constants.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../packages/eslint-plugin-nx/src/constants.ts"],"names":[],"mappings":";;;AAAA,yCAA6C;AAC7C,+BAA4B;AAEf,QAAA,oBAAoB,GAAG,IAAA,WAAI,EAAC,sBAAa,EAAE,oBAAoB,CAAC,CAAC;AAE9E;;;;;;;;;GASG;AACU,QAAA,wBAAwB,GAAG,WAAW,CAAC"}
|
package/src/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/src/index.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const typescript_1 = require("./configs/typescript");
|
|
4
|
-
const javascript_1 = require("./configs/javascript");
|
|
5
|
-
const react_tmp_1 = require("./configs/react-tmp");
|
|
6
|
-
const react_base_1 = require("./configs/react-base");
|
|
7
|
-
const react_jsx_1 = require("./configs/react-jsx");
|
|
8
|
-
const react_typescript_1 = require("./configs/react-typescript");
|
|
9
|
-
const angular_1 = require("./configs/angular");
|
|
10
|
-
const angular_template_1 = require("./configs/angular-template");
|
|
11
|
-
const enforce_module_boundaries_1 = require("./rules/enforce-module-boundaries");
|
|
12
|
-
const nx_plugin_checks_1 = require("./rules/nx-plugin-checks");
|
|
13
|
-
// Resolve any custom rules that might exist in the current workspace
|
|
14
|
-
const resolve_workspace_rules_1 = require("./resolve-workspace-rules");
|
|
15
|
-
module.exports = {
|
|
16
|
-
configs: {
|
|
17
|
-
typescript: typescript_1.default,
|
|
18
|
-
javascript: javascript_1.default,
|
|
19
|
-
react: react_tmp_1.default,
|
|
20
|
-
'react-base': react_base_1.default,
|
|
21
|
-
'react-typescript': react_typescript_1.default,
|
|
22
|
-
'react-jsx': react_jsx_1.default,
|
|
23
|
-
angular: angular_1.default,
|
|
24
|
-
'angular-template': angular_template_1.default,
|
|
25
|
-
},
|
|
26
|
-
rules: Object.assign({ [enforce_module_boundaries_1.RULE_NAME]: enforce_module_boundaries_1.default, [nx_plugin_checks_1.RULE_NAME]: nx_plugin_checks_1.default }, resolve_workspace_rules_1.workspaceRules),
|
|
27
|
-
};
|
|
28
|
-
//# sourceMappingURL=index.js.map
|
package/src/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/eslint-plugin-nx/src/index.ts"],"names":[],"mappings":";;AAAA,qDAA8C;AAC9C,qDAA8C;AAC9C,mDAA2C;AAC3C,qDAA6C;AAC7C,mDAA2C;AAC3C,iEAAyD;AACzD,+CAA4C;AAC5C,iEAAyD;AAEzD,iFAE2C;AAE3C,+DAEkC;AAElC,qEAAqE;AACrE,uEAA2D;AAE3D,MAAM,CAAC,OAAO,GAAG;IACf,OAAO,EAAE;QACP,UAAU,EAAV,oBAAU;QACV,UAAU,EAAV,oBAAU;QACV,KAAK,EAAE,mBAAQ;QACf,YAAY,EAAE,oBAAS;QACvB,kBAAkB,EAAE,0BAAe;QACnC,WAAW,EAAE,mBAAQ;QACrB,OAAO,EAAE,iBAAW;QACpB,kBAAkB,EAAE,0BAAe;KACpC;IACD,KAAK,kBACH,CAAC,qCAA+B,CAAC,EAAE,mCAAuB,EAC1D,CAAC,4BAAsB,CAAC,EAAE,0BAAkB,IACzC,wCAAc,CAClB;CACF,CAAC"}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.workspaceRules = void 0;
|
|
4
|
-
const fs_1 = require("fs");
|
|
5
|
-
const register_1 = require("nx/src/utils/register");
|
|
6
|
-
const constants_1 = require("./constants");
|
|
7
|
-
exports.workspaceRules = (() => {
|
|
8
|
-
// If `tools/eslint-rules` folder doesn't exist, there is no point trying to register and load it
|
|
9
|
-
if (!(0, fs_1.existsSync)(constants_1.WORKSPACE_PLUGIN_DIR)) {
|
|
10
|
-
return {};
|
|
11
|
-
}
|
|
12
|
-
// Register `tools/eslint-rules` for TS transpilation
|
|
13
|
-
const registrationCleanup = (0, register_1.registerTsProject)(constants_1.WORKSPACE_PLUGIN_DIR);
|
|
14
|
-
try {
|
|
15
|
-
/**
|
|
16
|
-
* Currently we only support applying the rules from the user's workspace plugin object
|
|
17
|
-
* (i.e. not other things that plugings can expose like configs, processors etc)
|
|
18
|
-
*/
|
|
19
|
-
const { rules } = require(constants_1.WORKSPACE_PLUGIN_DIR);
|
|
20
|
-
// Apply the namespace to the resolved rules
|
|
21
|
-
const namespacedRules = {};
|
|
22
|
-
for (const [ruleName, ruleConfig] of Object.entries(rules)) {
|
|
23
|
-
namespacedRules[`${constants_1.WORKSPACE_RULE_NAMESPACE}/${ruleName}`] = ruleConfig;
|
|
24
|
-
}
|
|
25
|
-
return namespacedRules;
|
|
26
|
-
}
|
|
27
|
-
catch (err) {
|
|
28
|
-
return {};
|
|
29
|
-
}
|
|
30
|
-
finally {
|
|
31
|
-
if (registrationCleanup) {
|
|
32
|
-
registrationCleanup();
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
})();
|
|
36
|
-
//# sourceMappingURL=resolve-workspace-rules.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"resolve-workspace-rules.js","sourceRoot":"","sources":["../../../../packages/eslint-plugin-nx/src/resolve-workspace-rules.ts"],"names":[],"mappings":";;;AACA,2BAAgC;AAChC,oDAA0D;AAC1D,2CAA6E;AAIhE,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,IAAA,4BAAiB,EAAC,gCAAoB,CAAC,CAAC;IACpE,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"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { DepConstraint } from '../utils/runtime-lint-utils';
|
|
2
|
-
type Options = [
|
|
3
|
-
{
|
|
4
|
-
allow: string[];
|
|
5
|
-
depConstraints: DepConstraint[];
|
|
6
|
-
enforceBuildableLibDependency: boolean;
|
|
7
|
-
allowCircularSelfDependency: boolean;
|
|
8
|
-
checkDynamicDependenciesExceptions: string[];
|
|
9
|
-
banTransitiveDependencies: boolean;
|
|
10
|
-
checkNestedExternalImports: boolean;
|
|
11
|
-
}
|
|
12
|
-
];
|
|
13
|
-
export type MessageIds = 'noRelativeOrAbsoluteImportsAcrossLibraries' | 'noSelfCircularDependencies' | 'noCircularDependencies' | 'noImportsOfApps' | 'noImportsOfE2e' | 'noImportOfNonBuildableLibraries' | 'noImportsOfLazyLoadedLibraries' | 'projectWithoutTagsCannotHaveDependencies' | 'bannedExternalImportsViolation' | 'nestedBannedExternalImportsViolation' | 'noTransitiveDependencies' | 'onlyTagsConstraintViolation' | 'emptyOnlyTagsConstraintViolation' | 'notTagsConstraintViolation';
|
|
14
|
-
export declare const RULE_NAME = "enforce-module-boundaries";
|
|
15
|
-
declare const _default: import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<MessageIds, Options, import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleListener>;
|
|
16
|
-
export default _default;
|