@nx/eslint-plugin 0.0.0-pr-22179-271588f

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.
Files changed (48) hide show
  1. package/LICENSE +22 -0
  2. package/README.md +68 -0
  3. package/migrations.json +18 -0
  4. package/package.json +54 -0
  5. package/src/configs/angular-template.d.ts +20 -0
  6. package/src/configs/angular-template.js +21 -0
  7. package/src/configs/angular.d.ts +25 -0
  8. package/src/configs/angular.js +27 -0
  9. package/src/configs/javascript.d.ts +62 -0
  10. package/src/configs/javascript.js +70 -0
  11. package/src/configs/react-base.d.ts +112 -0
  12. package/src/configs/react-base.js +141 -0
  13. package/src/configs/react-jsx.d.ts +71 -0
  14. package/src/configs/react-jsx.js +64 -0
  15. package/src/configs/react-tmp.d.ts +12 -0
  16. package/src/configs/react-tmp.js +17 -0
  17. package/src/configs/react-typescript.d.ts +40 -0
  18. package/src/configs/react-typescript.js +54 -0
  19. package/src/configs/typescript.d.ts +44 -0
  20. package/src/configs/typescript.js +53 -0
  21. package/src/constants.d.ts +13 -0
  22. package/src/constants.js +18 -0
  23. package/src/index.d.ts +1 -0
  24. package/src/index.js +34 -0
  25. package/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.d.ts +2 -0
  26. package/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.js +43 -0
  27. package/src/migrations/update-17-2-6-rename-workspace-rules/rename-workspace-rules.d.ts +2 -0
  28. package/src/migrations/update-17-2-6-rename-workspace-rules/rename-workspace-rules.js +29 -0
  29. package/src/resolve-workspace-rules.d.ts +4 -0
  30. package/src/resolve-workspace-rules.js +38 -0
  31. package/src/rules/dependency-checks.d.ts +17 -0
  32. package/src/rules/dependency-checks.js +240 -0
  33. package/src/rules/enforce-module-boundaries.d.ts +18 -0
  34. package/src/rules/enforce-module-boundaries.js +480 -0
  35. package/src/rules/nx-plugin-checks.d.ts +21 -0
  36. package/src/rules/nx-plugin-checks.js +392 -0
  37. package/src/utils/ast-utils.d.ts +12 -0
  38. package/src/utils/ast-utils.js +220 -0
  39. package/src/utils/config-utils.d.ts +6 -0
  40. package/src/utils/config-utils.js +18 -0
  41. package/src/utils/graph-utils.d.ts +6 -0
  42. package/src/utils/graph-utils.js +129 -0
  43. package/src/utils/package-json-utils.d.ts +4 -0
  44. package/src/utils/package-json-utils.js +37 -0
  45. package/src/utils/project-graph-utils.d.ts +10 -0
  46. package/src/utils/project-graph-utils.js +53 -0
  47. package/src/utils/runtime-lint-utils.d.ts +88 -0
  48. package/src/utils/runtime-lint-utils.js +365 -0
package/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ (The MIT License)
2
+
3
+ Copyright (c) 2017-2023 Narwhal Technologies Inc.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ 'Software'), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
20
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,68 @@
1
+ <p style="text-align: center;">
2
+ <picture>
3
+ <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-dark.svg">
4
+ <img alt="Nx - Smart Monorepos · Fast CI" src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-light.svg" width="100%">
5
+ </picture>
6
+ </p>
7
+
8
+ <div style="text-align: center;">
9
+
10
+ [![CircleCI](https://circleci.com/gh/nrwl/nx.svg?style=svg)](https://circleci.com/gh/nrwl/nx)
11
+ [![License](https://img.shields.io/npm/l/@nx/workspace.svg?style=flat-square)]()
12
+ [![NPM Version](https://badge.fury.io/js/%40nrwl%2Fworkspace.svg)](https://www.npmjs.com/@nx/workspace)
13
+ [![Semantic Release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=flat-square)]()
14
+ [![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
15
+ [![Join the chat at https://gitter.im/nrwl-nx/community](https://badges.gitter.im/nrwl-nx/community.svg)](https://gitter.im/nrwl-nx/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
16
+ [![Join us on the Official Nx Discord Server](https://img.shields.io/discord/1143497901675401286?label=discord)](https://go.nx.dev/community)
17
+
18
+ </div>
19
+
20
+
21
+ <hr>
22
+
23
+ # Nx: Smart Monorepos · Fast CI
24
+
25
+ Nx is a build system with built-in tooling and advanced CI capabilities. It helps you maintain and scale monorepos, both locally and on CI.
26
+
27
+ This package is an ESLint plugin for Nx.
28
+
29
+ ## Getting Started
30
+
31
+ ### Creating an Nx Workspace
32
+
33
+ **Using `npx`**
34
+
35
+ ```bash
36
+ npx create-nx-workspace
37
+ ```
38
+
39
+ **Using `npm init`**
40
+
41
+ ```bash
42
+ npm init nx-workspace
43
+ ```
44
+
45
+ **Using `yarn create`**
46
+
47
+ ```bash
48
+ yarn create nx-workspace
49
+ ```
50
+
51
+ ### Adding Nx to an Existing Repository
52
+
53
+ Run:
54
+
55
+ ```bash
56
+ npx nx@latest init
57
+ ```
58
+
59
+ ## Documentation & Resources
60
+
61
+ - [Nx.Dev: Documentation, Guides, Tutorials](https://nx.dev)
62
+ - [Intro to Nx](https://nx.dev/getting-started/intro)
63
+ - [Official Nx YouTube Channel](https://www.youtube.com/@NxDevtools)
64
+ - [Blog Posts About Nx](https://blog.nrwl.io/nx/home)
65
+
66
+ <p style="text-align: center;"><a href="https://nx.dev/#learning-materials" target="_blank" rel="noreferrer"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-courses-and-videos.svg"
67
+ width="100%" alt="Nx - Smart Monorepos · Fast CI"></a></p>
68
+
@@ -0,0 +1,18 @@
1
+ {
2
+ "generators": {
3
+ "update-16-0-0-add-nx-packages": {
4
+ "cli": "nx",
5
+ "version": "16.0.0-beta.1",
6
+ "description": "Replace @nrwl/eslint-plugin-nx with @nx/eslint-plugin",
7
+ "implementation": "./src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages"
8
+ },
9
+ "update-17-2-6-rename-workspace-rules": {
10
+ "cli": "nx",
11
+ "version": "17.2.6-beta.1",
12
+ "description": "Rename workspace rules from @nx/workspace/name to @nx/workspace-name",
13
+ "implementation": "./src/migrations/update-17-2-6-rename-workspace-rules/rename-workspace-rules"
14
+ }
15
+ },
16
+ "packageJsonUpdates": {},
17
+ "version": "0.1"
18
+ }
package/package.json ADDED
@@ -0,0 +1,54 @@
1
+ {
2
+ "name": "@nx/eslint-plugin",
3
+ "version": "0.0.0-pr-22179-271588f",
4
+ "private": false,
5
+ "description": "The eslint-plugin package is an ESLint plugin that contains a collection of recommended ESLint rule configurations which you can extend from in your own ESLint configs, as well as an Nx-specific lint rule called enforce-module-boundaries.",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "https://github.com/nrwl/nx.git",
9
+ "directory": "packages/eslint-plugin"
10
+ },
11
+ "keywords": [
12
+ "Monorepo",
13
+ "Web",
14
+ "Lint",
15
+ "ESLint",
16
+ "CLI"
17
+ ],
18
+ "main": "./src/index.js",
19
+ "typings": "./src/index.d.ts",
20
+ "author": "Victor Savkin",
21
+ "license": "MIT",
22
+ "bugs": {
23
+ "url": "https://github.com/nrwl/nx/issues"
24
+ },
25
+ "homepage": "https://nx.dev",
26
+ "peerDependencies": {
27
+ "@typescript-eslint/parser": "^6.13.2 || ^7.0.0",
28
+ "eslint-config-prettier": "^9.0.0"
29
+ },
30
+ "peerDependenciesMeta": {
31
+ "eslint-config-prettier": {
32
+ "optional": true
33
+ }
34
+ },
35
+ "dependencies": {
36
+ "@nx/devkit": "0.0.0-pr-22179-271588f",
37
+ "@nx/js": "0.0.0-pr-22179-271588f",
38
+ "@typescript-eslint/type-utils": "^6.13.2",
39
+ "@typescript-eslint/utils": "^6.13.2",
40
+ "chalk": "^4.1.0",
41
+ "confusing-browser-globals": "^1.0.9",
42
+ "jsonc-eslint-parser": "^2.1.0",
43
+ "semver": "^7.5.3",
44
+ "tslib": "^2.3.0",
45
+ "@nrwl/eslint-plugin-nx": "0.0.0-pr-22179-271588f"
46
+ },
47
+ "publishConfig": {
48
+ "access": "public"
49
+ },
50
+ "nx-migrations": {
51
+ "migrations": "./migrations.json"
52
+ },
53
+ "type": "commonjs"
54
+ }
@@ -0,0 +1,20 @@
1
+ /**
2
+ * This configuration is intended to be applied to ALL .html files in Angular
3
+ * projects within an Nx workspace, as well as extracted inline templates from
4
+ * .component.ts files (or similar).
5
+ *
6
+ * It should therefore NOT contain any rules or plugins which are related to
7
+ * Angular source code.
8
+ *
9
+ * NOTE: The processor to extract the inline templates is applied in users'
10
+ * configs by the relevant schematic.
11
+ *
12
+ * This configuration is intended to be combined with other configs from this
13
+ * package.
14
+ */
15
+ declare const _default: {
16
+ plugins: string[];
17
+ extends: string[];
18
+ rules: {};
19
+ };
20
+ export default _default;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ /**
4
+ * This configuration is intended to be applied to ALL .html files in Angular
5
+ * projects within an Nx workspace, as well as extracted inline templates from
6
+ * .component.ts files (or similar).
7
+ *
8
+ * It should therefore NOT contain any rules or plugins which are related to
9
+ * Angular source code.
10
+ *
11
+ * NOTE: The processor to extract the inline templates is applied in users'
12
+ * configs by the relevant schematic.
13
+ *
14
+ * This configuration is intended to be combined with other configs from this
15
+ * package.
16
+ */
17
+ exports.default = {
18
+ plugins: ['@angular-eslint/template'],
19
+ extends: ['plugin:@angular-eslint/template/recommended'],
20
+ rules: {},
21
+ };
@@ -0,0 +1,25 @@
1
+ /**
2
+ * This configuration is intended to be applied to ALL .ts files in Angular
3
+ * projects within an Nx workspace.
4
+ *
5
+ * It should therefore NOT contain any rules or plugins which are related to
6
+ * Angular Templates, or more cross-cutting concerns which are not specific
7
+ * to Angular.
8
+ *
9
+ * This configuration is intended to be combined with other configs from this
10
+ * package.
11
+ */
12
+ declare const _default: {
13
+ env: {
14
+ browser: boolean;
15
+ es6: boolean;
16
+ node: boolean;
17
+ };
18
+ plugins: string[];
19
+ extends: string[];
20
+ parserOptions: {
21
+ project: any[];
22
+ };
23
+ rules: {};
24
+ };
25
+ export default _default;
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ /**
4
+ * This configuration is intended to be applied to ALL .ts files in Angular
5
+ * projects within an Nx workspace.
6
+ *
7
+ * It should therefore NOT contain any rules or plugins which are related to
8
+ * Angular Templates, or more cross-cutting concerns which are not specific
9
+ * to Angular.
10
+ *
11
+ * This configuration is intended to be combined with other configs from this
12
+ * package.
13
+ */
14
+ exports.default = {
15
+ env: {
16
+ browser: true,
17
+ es6: true,
18
+ node: true,
19
+ },
20
+ plugins: ['@angular-eslint'],
21
+ extends: ['plugin:@angular-eslint/recommended'],
22
+ parserOptions: {
23
+ // Unset the default value for parserOptions.project that is found in earlier versions of @angular-eslint
24
+ project: [],
25
+ },
26
+ rules: {},
27
+ };
@@ -0,0 +1,62 @@
1
+ /**
2
+ * This configuration is intended to be applied to ALL .js and .jsx 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
+ * We use @typescript-eslint/parser rather than the built in JS parser
9
+ * because that is what Nx ESLint configs have always done and we don't
10
+ * want to change too much all at once.
11
+ *
12
+ * TODO: Evaluate switching to the built-in JS parser (espree) in Nx v11,
13
+ * it should yield a performance improvement but could introduce subtle
14
+ * breaking changes - we should also look to replace all the @typescript-eslint
15
+ * related plugins and rules below.
16
+ */
17
+ declare const _default: {
18
+ env: {
19
+ browser: boolean;
20
+ node: boolean;
21
+ };
22
+ parser: string;
23
+ parserOptions: {
24
+ ecmaVersion: number;
25
+ sourceType: string;
26
+ };
27
+ plugins: string[];
28
+ extends: string[];
29
+ rules: {
30
+ '@typescript-eslint/explicit-member-accessibility': string;
31
+ '@typescript-eslint/explicit-module-boundary-types': string;
32
+ '@typescript-eslint/explicit-function-return-type': string;
33
+ '@typescript-eslint/no-parameter-properties': string;
34
+ /**
35
+ * Until ESM usage in Node matures, using require in e.g. JS config files
36
+ * is by far the more common thing to do, so disabling this to avoid users
37
+ * having to frequently use "eslint-disable-next-line" in their configs.
38
+ */
39
+ '@typescript-eslint/no-var-requires': string;
40
+ /**
41
+ * From https://typescript-eslint.io/blog/announcing-typescript-eslint-v6/#updated-configuration-rules
42
+ *
43
+ * The following rules were added to preserve the linting rules that were
44
+ * previously defined v5 of `@typescript-eslint`. v6 of `@typescript-eslint`
45
+ * changed how configurations are defined.
46
+ *
47
+ * TODO(v19): re-evalute these deviations from @typescript-eslint/recommended in v19 of Nx
48
+ */
49
+ 'no-extra-semi': string;
50
+ '@typescript-eslint/no-extra-semi': string;
51
+ '@typescript-eslint/no-non-null-assertion': string;
52
+ '@typescript-eslint/adjacent-overload-signatures': string;
53
+ '@typescript-eslint/prefer-namespace-keyword': string;
54
+ 'no-empty-function': string;
55
+ '@typescript-eslint/no-empty-function': string;
56
+ '@typescript-eslint/no-inferrable-types': string;
57
+ '@typescript-eslint/no-unused-vars': string;
58
+ '@typescript-eslint/no-empty-interface': string;
59
+ '@typescript-eslint/no-explicit-any': string;
60
+ };
61
+ };
62
+ export default _default;
@@ -0,0 +1,70 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const config_utils_1 = require("../utils/config-utils");
4
+ const isPrettierAvailable = (0, config_utils_1.packageExists)('prettier') && (0, config_utils_1.packageExists)('eslint-config-prettier');
5
+ /**
6
+ * This configuration is intended to be applied to ALL .js and .jsx files
7
+ * within an Nx workspace.
8
+ *
9
+ * It should therefore NOT contain any rules or plugins which are specific
10
+ * to one ecosystem, such as React, Angular, Node etc.
11
+ *
12
+ * We use @typescript-eslint/parser rather than the built in JS parser
13
+ * because that is what Nx ESLint configs have always done and we don't
14
+ * want to change too much all at once.
15
+ *
16
+ * TODO: Evaluate switching to the built-in JS parser (espree) in Nx v11,
17
+ * it should yield a performance improvement but could introduce subtle
18
+ * breaking changes - we should also look to replace all the @typescript-eslint
19
+ * related plugins and rules below.
20
+ */
21
+ exports.default = {
22
+ env: {
23
+ browser: true,
24
+ node: true,
25
+ },
26
+ parser: '@typescript-eslint/parser',
27
+ parserOptions: {
28
+ ecmaVersion: 2020,
29
+ sourceType: 'module',
30
+ },
31
+ plugins: ['@typescript-eslint'],
32
+ extends: [
33
+ 'eslint:recommended',
34
+ 'plugin:@typescript-eslint/eslint-recommended',
35
+ 'plugin:@typescript-eslint/recommended',
36
+ ...(isPrettierAvailable ? ['prettier'] : []),
37
+ ],
38
+ rules: {
39
+ '@typescript-eslint/explicit-member-accessibility': 'off',
40
+ '@typescript-eslint/explicit-module-boundary-types': 'off',
41
+ '@typescript-eslint/explicit-function-return-type': 'off',
42
+ '@typescript-eslint/no-parameter-properties': 'off',
43
+ /**
44
+ * Until ESM usage in Node matures, using require in e.g. JS config files
45
+ * is by far the more common thing to do, so disabling this to avoid users
46
+ * having to frequently use "eslint-disable-next-line" in their configs.
47
+ */
48
+ '@typescript-eslint/no-var-requires': 'off',
49
+ /**
50
+ * From https://typescript-eslint.io/blog/announcing-typescript-eslint-v6/#updated-configuration-rules
51
+ *
52
+ * The following rules were added to preserve the linting rules that were
53
+ * previously defined v5 of `@typescript-eslint`. v6 of `@typescript-eslint`
54
+ * changed how configurations are defined.
55
+ *
56
+ * TODO(v19): re-evalute these deviations from @typescript-eslint/recommended in v19 of Nx
57
+ */
58
+ 'no-extra-semi': 'off',
59
+ '@typescript-eslint/no-extra-semi': 'error',
60
+ '@typescript-eslint/no-non-null-assertion': 'warn',
61
+ '@typescript-eslint/adjacent-overload-signatures': 'error',
62
+ '@typescript-eslint/prefer-namespace-keyword': 'error',
63
+ 'no-empty-function': 'off',
64
+ '@typescript-eslint/no-empty-function': 'error',
65
+ '@typescript-eslint/no-inferrable-types': 'error',
66
+ '@typescript-eslint/no-unused-vars': 'warn',
67
+ '@typescript-eslint/no-empty-interface': 'error',
68
+ '@typescript-eslint/no-explicit-any': 'warn',
69
+ },
70
+ };
@@ -0,0 +1,112 @@
1
+ /**
2
+ * Rule set originally adapted from:
3
+ * https://github.com/facebook/create-react-app/blob/567f36c9235f1e1fd4a76dc6d1ae00be754ca047/packages/eslint-config-react-app/index.js
4
+ */
5
+ declare const _default: {
6
+ plugins: string[];
7
+ env: {
8
+ browser: boolean;
9
+ commonjs: boolean;
10
+ es6: boolean;
11
+ jest: boolean;
12
+ node: boolean;
13
+ };
14
+ rules: {
15
+ /**
16
+ * Standard ESLint rule configurations
17
+ * https://eslint.org/docs/rules
18
+ */
19
+ 'array-callback-return': string;
20
+ 'dot-location': string[];
21
+ eqeqeq: string[];
22
+ 'new-parens': string;
23
+ 'no-caller': string;
24
+ 'no-cond-assign': string[];
25
+ 'no-const-assign': string;
26
+ 'no-control-regex': string;
27
+ 'no-delete-var': string;
28
+ 'no-dupe-args': string;
29
+ 'no-dupe-keys': string;
30
+ 'no-duplicate-case': string;
31
+ 'no-empty-character-class': string;
32
+ 'no-empty-pattern': string;
33
+ 'no-eval': string;
34
+ 'no-ex-assign': string;
35
+ 'no-extend-native': string;
36
+ 'no-extra-bind': string;
37
+ 'no-extra-label': string;
38
+ 'no-fallthrough': string;
39
+ 'no-func-assign': string;
40
+ 'no-implied-eval': string;
41
+ 'no-invalid-regexp': string;
42
+ 'no-iterator': string;
43
+ 'no-label-var': string;
44
+ 'no-labels': (string | {
45
+ allowLoop: boolean;
46
+ allowSwitch: boolean;
47
+ })[];
48
+ 'no-lone-blocks': string;
49
+ 'no-loop-func': string;
50
+ 'no-mixed-operators': (string | {
51
+ groups: string[][];
52
+ allowSamePrecedence: boolean;
53
+ })[];
54
+ 'no-multi-str': string;
55
+ 'no-native-reassign': string;
56
+ 'no-negated-in-lhs': string;
57
+ 'no-new-func': string;
58
+ 'no-new-object': string;
59
+ 'no-new-symbol': string;
60
+ 'no-new-wrappers': string;
61
+ 'no-obj-calls': string;
62
+ 'no-octal': string;
63
+ 'no-octal-escape': string;
64
+ 'no-redeclare': string;
65
+ 'no-regex-spaces': string;
66
+ 'no-restricted-syntax': string[];
67
+ 'no-script-url': string;
68
+ 'no-self-assign': string;
69
+ 'no-self-compare': string;
70
+ 'no-sequences': string;
71
+ 'no-shadow-restricted-names': string;
72
+ 'no-sparse-arrays': string;
73
+ 'no-template-curly-in-string': string;
74
+ 'no-this-before-super': string;
75
+ 'no-throw-literal': string;
76
+ 'no-restricted-globals': string[];
77
+ 'no-unexpected-multiline': string;
78
+ 'no-unreachable': string;
79
+ 'no-unused-expressions': string;
80
+ 'no-unused-labels': string;
81
+ 'no-useless-computed-key': string;
82
+ 'no-useless-concat': string;
83
+ 'no-useless-escape': string;
84
+ 'no-useless-rename': (string | {
85
+ ignoreDestructuring: boolean;
86
+ ignoreImport: boolean;
87
+ ignoreExport: boolean;
88
+ })[];
89
+ 'no-with': string;
90
+ 'no-whitespace-before-property': string;
91
+ 'require-yield': string;
92
+ 'rest-spread-spacing': string[];
93
+ strict: string[];
94
+ 'unicode-bom': string[];
95
+ 'use-isnan': string;
96
+ 'valid-typeof': string;
97
+ 'no-restricted-properties': (string | {
98
+ object: string;
99
+ property: string;
100
+ message: string;
101
+ })[];
102
+ 'getter-return': string;
103
+ /**
104
+ * Import rule configurations
105
+ * https://github.com/benmosher/eslint-plugin-import
106
+ */
107
+ 'import/first': string;
108
+ 'import/no-amd': string;
109
+ 'import/no-webpack-loader-syntax': string;
110
+ };
111
+ };
112
+ export default _default;
@@ -0,0 +1,141 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ /**
5
+ * This configuration is intended to be applied to ALL files within a React
6
+ * project in an Nx workspace.
7
+ *
8
+ * It should therefore NOT contain any rules or plugins which are specific
9
+ * to one particular variant, e.g. TypeScript vs JavaScript, .js vs .jsx etc
10
+ *
11
+ * This configuration is intended to be combined with other configs from this
12
+ * package.
13
+ */
14
+ const confusing_browser_globals_1 = tslib_1.__importDefault(require("confusing-browser-globals"));
15
+ /**
16
+ * Rule set originally adapted from:
17
+ * https://github.com/facebook/create-react-app/blob/567f36c9235f1e1fd4a76dc6d1ae00be754ca047/packages/eslint-config-react-app/index.js
18
+ */
19
+ exports.default = {
20
+ plugins: ['import'],
21
+ env: {
22
+ browser: true,
23
+ commonjs: true,
24
+ es6: true,
25
+ jest: true,
26
+ node: true,
27
+ },
28
+ rules: {
29
+ /**
30
+ * Standard ESLint rule configurations
31
+ * https://eslint.org/docs/rules
32
+ */
33
+ 'array-callback-return': 'warn',
34
+ 'dot-location': ['warn', 'property'],
35
+ eqeqeq: ['warn', 'smart'],
36
+ 'new-parens': 'warn',
37
+ 'no-caller': 'warn',
38
+ 'no-cond-assign': ['warn', 'except-parens'],
39
+ 'no-const-assign': 'warn',
40
+ 'no-control-regex': 'warn',
41
+ 'no-delete-var': 'warn',
42
+ 'no-dupe-args': 'warn',
43
+ 'no-dupe-keys': 'warn',
44
+ 'no-duplicate-case': 'warn',
45
+ 'no-empty-character-class': 'warn',
46
+ 'no-empty-pattern': 'warn',
47
+ 'no-eval': 'warn',
48
+ 'no-ex-assign': 'warn',
49
+ 'no-extend-native': 'warn',
50
+ 'no-extra-bind': 'warn',
51
+ 'no-extra-label': 'warn',
52
+ 'no-fallthrough': 'warn',
53
+ 'no-func-assign': 'warn',
54
+ 'no-implied-eval': 'warn',
55
+ 'no-invalid-regexp': 'warn',
56
+ 'no-iterator': 'warn',
57
+ 'no-label-var': 'warn',
58
+ 'no-labels': ['warn', { allowLoop: true, allowSwitch: false }],
59
+ 'no-lone-blocks': 'warn',
60
+ 'no-loop-func': 'warn',
61
+ 'no-mixed-operators': [
62
+ 'warn',
63
+ {
64
+ groups: [
65
+ ['&', '|', '^', '~', '<<', '>>', '>>>'],
66
+ ['==', '!=', '===', '!==', '>', '>=', '<', '<='],
67
+ ['&&', '||'],
68
+ ['in', 'instanceof'],
69
+ ],
70
+ allowSamePrecedence: false,
71
+ },
72
+ ],
73
+ 'no-multi-str': 'warn',
74
+ 'no-native-reassign': 'warn',
75
+ 'no-negated-in-lhs': 'warn',
76
+ 'no-new-func': 'warn',
77
+ 'no-new-object': 'warn',
78
+ 'no-new-symbol': 'warn',
79
+ 'no-new-wrappers': 'warn',
80
+ 'no-obj-calls': 'warn',
81
+ 'no-octal': 'warn',
82
+ 'no-octal-escape': 'warn',
83
+ 'no-redeclare': 'warn',
84
+ 'no-regex-spaces': 'warn',
85
+ 'no-restricted-syntax': ['warn', 'WithStatement'],
86
+ 'no-script-url': 'warn',
87
+ 'no-self-assign': 'warn',
88
+ 'no-self-compare': 'warn',
89
+ 'no-sequences': 'warn',
90
+ 'no-shadow-restricted-names': 'warn',
91
+ 'no-sparse-arrays': 'warn',
92
+ 'no-template-curly-in-string': 'warn',
93
+ 'no-this-before-super': 'warn',
94
+ 'no-throw-literal': 'warn',
95
+ 'no-restricted-globals': ['error'].concat(confusing_browser_globals_1.default),
96
+ 'no-unexpected-multiline': 'warn',
97
+ 'no-unreachable': 'warn',
98
+ 'no-unused-expressions': 'off',
99
+ 'no-unused-labels': 'warn',
100
+ 'no-useless-computed-key': 'warn',
101
+ 'no-useless-concat': 'warn',
102
+ 'no-useless-escape': 'warn',
103
+ 'no-useless-rename': [
104
+ 'warn',
105
+ {
106
+ ignoreDestructuring: false,
107
+ ignoreImport: false,
108
+ ignoreExport: false,
109
+ },
110
+ ],
111
+ 'no-with': 'warn',
112
+ 'no-whitespace-before-property': 'warn',
113
+ 'require-yield': 'warn',
114
+ 'rest-spread-spacing': ['warn', 'never'],
115
+ strict: ['warn', 'never'],
116
+ 'unicode-bom': ['warn', 'never'],
117
+ 'use-isnan': 'warn',
118
+ 'valid-typeof': 'warn',
119
+ 'no-restricted-properties': [
120
+ 'error',
121
+ {
122
+ object: 'require',
123
+ property: 'ensure',
124
+ message: 'Please use import() instead. More info: https://facebook.github.io/create-react-app/docs/code-splitting',
125
+ },
126
+ {
127
+ object: 'System',
128
+ property: 'import',
129
+ message: 'Please use import() instead. More info: https://facebook.github.io/create-react-app/docs/code-splitting',
130
+ },
131
+ ],
132
+ 'getter-return': 'warn',
133
+ /**
134
+ * Import rule configurations
135
+ * https://github.com/benmosher/eslint-plugin-import
136
+ */
137
+ 'import/first': 'error',
138
+ 'import/no-amd': 'error',
139
+ 'import/no-webpack-loader-syntax': 'error',
140
+ },
141
+ };