@ms-cloudpack/eslint-plugin 0.2.0 → 0.2.2
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/README.md +29 -4
- package/lib/configs/onboarding-requiring-type-checking.d.ts +3 -0
- package/lib/configs/onboarding-requiring-type-checking.d.ts.map +1 -0
- package/lib/configs/onboarding-requiring-type-checking.js +10 -0
- package/lib/configs/onboarding-requiring-type-checking.js.map +1 -0
- package/lib/configs/onboarding.d.ts +2 -2
- package/lib/configs/onboarding.d.ts.map +1 -1
- package/lib/configs/onboarding.js +1 -1
- package/lib/configs/onboarding.js.map +1 -1
- package/lib/configs/recommended-requiring-type-checking.d.ts +3 -0
- package/lib/configs/recommended-requiring-type-checking.d.ts.map +1 -0
- package/lib/configs/recommended-requiring-type-checking.js +11 -0
- package/lib/configs/recommended-requiring-type-checking.js.map +1 -0
- package/lib/configs/recommended.d.ts +2 -2
- package/lib/configs/recommended.d.ts.map +1 -1
- package/lib/configs/recommended.js +0 -2
- package/lib/configs/recommended.js.map +1 -1
- package/lib/index.d.ts +3 -10
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +6 -1
- package/lib/index.js.map +1 -1
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -6,9 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
### Recommended
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
To enable the `@ms-cloudpack/recommended` configuration, add it to your ESLint config file:
|
|
9
|
+
The `@ms-cloudpack/recommended` config includes rules that are recommended for helping Cloudpack work better in your repo. None of these rules require type checking. To enable:
|
|
12
10
|
|
|
13
11
|
```json
|
|
14
12
|
{
|
|
@@ -17,11 +15,34 @@ To enable the `@ms-cloudpack/recommended` configuration, add it to your ESLint c
|
|
|
17
15
|
}
|
|
18
16
|
```
|
|
19
17
|
|
|
20
|
-
`@ms-cloudpack/recommended`
|
|
18
|
+
`@ms-cloudpack/recommended` includes the following rules:
|
|
21
19
|
|
|
22
20
|
- `@ms-cloudpack/no-unsupported-imports`
|
|
23
21
|
- [`@rnx-kit/no-const-enum](https://www.npmjs.com/package/@rnx-kit/eslint-plugin)
|
|
24
22
|
- [`@rnx-kit/no-export-all](https://www.npmjs.com/package/@rnx-kit/eslint-plugin)
|
|
23
|
+
|
|
24
|
+
### Recommended requiring type checking
|
|
25
|
+
|
|
26
|
+
The `@ms-cloudpack/recommended-requiring-type-checking` config includes additional rules which are helpful for Cloudpack but require type information. Following the pattern of typescript-eslint, this config **does not** include the rules from the basic "recommended" config.
|
|
27
|
+
|
|
28
|
+
To enable, follow the instructions for [linting with type information](https://typescript-eslint.io/linting/typed-linting), then add the config to `extends`:
|
|
29
|
+
|
|
30
|
+
```jsonc
|
|
31
|
+
{
|
|
32
|
+
"plugins": ["@ms-cloudpack"],
|
|
33
|
+
"extends": [
|
|
34
|
+
// Both of these should be included
|
|
35
|
+
"plugin:@ms-cloudpack/recommended",
|
|
36
|
+
"plugin:@ms-cloudpack/recommended-requiring-type-checking"
|
|
37
|
+
],
|
|
38
|
+
"parserOptions": {
|
|
39
|
+
// `project` must be specified; see link above
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
`@ms-cloudpack/recommended-requiring-type-checking` includes the following rules:
|
|
45
|
+
|
|
25
46
|
- [`@typescript-eslint/consistent-type-exports`](https://typescript-eslint.io/rules/consistent-type-exports)
|
|
26
47
|
- [`@typescript-eslint/consistent-type-imports`](https://typescript-eslint.io/rules/consistent-type-imports)
|
|
27
48
|
|
|
@@ -29,6 +50,10 @@ To enable the `@ms-cloudpack/recommended` configuration, add it to your ESLint c
|
|
|
29
50
|
|
|
30
51
|
The `@ms-cloudpack/onboarding` config includes the same rules as `@ms-cloudpack/recommended`, but at `warn` level.
|
|
31
52
|
|
|
53
|
+
### Onboarding requiring type checking
|
|
54
|
+
|
|
55
|
+
The `@ms-cloudpack/onboarding-requiring-type-checking` config includes the same rules as `@ms-cloudpack/recommended-requiring-type-checking`, but at `warn` level. Following the pattern of typescript-eslint, this config **does not** include the rules from the basic "onboarding" config.
|
|
56
|
+
|
|
32
57
|
## Included rules
|
|
33
58
|
|
|
34
59
|
- ✓: Enabled with `@ms-cloudpack/recommended`
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"onboarding-requiring-type-checking.d.ts","sourceRoot":"","sources":["../../src/configs/onboarding-requiring-type-checking.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAGzD,eAAO,MAAM,+BAA+B,EAAE,QAAQ,CAAC,MAAM,CAAC,MAI7D,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.onboardingRequiringTypeChecking = void 0;
|
|
4
|
+
const recommended_requiring_type_checking_1 = require("./recommended-requiring-type-checking");
|
|
5
|
+
exports.onboardingRequiringTypeChecking = {
|
|
6
|
+
...recommended_requiring_type_checking_1.recommendedRequiringTypeChecking,
|
|
7
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
8
|
+
rules: Object.fromEntries(Object.keys(recommended_requiring_type_checking_1.recommendedRequiringTypeChecking.rules).map((rule) => [rule, 'warn'])),
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=onboarding-requiring-type-checking.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"onboarding-requiring-type-checking.js","sourceRoot":"","sources":["../../src/configs/onboarding-requiring-type-checking.ts"],"names":[],"mappings":";;;AACA,+FAAyF;AAE5E,QAAA,+BAA+B,GAA2B;IACrE,GAAG,sEAAgC;IACnC,oEAAoE;IACpE,KAAK,EAAE,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,IAAI,CAAC,sEAAgC,CAAC,KAAM,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC;CAC9G,CAAC","sourcesContent":["import type { TSESLint } from '@typescript-eslint/utils';\nimport { recommendedRequiringTypeChecking } from './recommended-requiring-type-checking';\n\nexport const onboardingRequiringTypeChecking: TSESLint.Linter.Config = {\n ...recommendedRequiringTypeChecking,\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n rules: Object.fromEntries(Object.keys(recommendedRequiringTypeChecking.rules!).map((rule) => [rule, 'warn'])),\n};\n"]}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare const onboarding:
|
|
1
|
+
import type { TSESLint } from '@typescript-eslint/utils';
|
|
2
|
+
export declare const onboarding: TSESLint.Linter.Config;
|
|
3
3
|
//# sourceMappingURL=onboarding.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"onboarding.d.ts","sourceRoot":"","sources":["../../src/configs/onboarding.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"onboarding.d.ts","sourceRoot":"","sources":["../../src/configs/onboarding.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAGzD,eAAO,MAAM,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC,MAIxC,CAAC"}
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.onboarding = void 0;
|
|
4
4
|
const recommended_1 = require("./recommended");
|
|
5
5
|
exports.onboarding = {
|
|
6
|
-
|
|
6
|
+
...recommended_1.recommended,
|
|
7
7
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
8
8
|
rules: Object.fromEntries(Object.keys(recommended_1.recommended.rules).map((rule) => [rule, 'warn'])),
|
|
9
9
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"onboarding.js","sourceRoot":"","sources":["../../src/configs/onboarding.ts"],"names":[],"mappings":";;;AACA,+CAA4C;AAE/B,QAAA,UAAU,
|
|
1
|
+
{"version":3,"file":"onboarding.js","sourceRoot":"","sources":["../../src/configs/onboarding.ts"],"names":[],"mappings":";;;AACA,+CAA4C;AAE/B,QAAA,UAAU,GAA2B;IAChD,GAAG,yBAAW;IACd,oEAAoE;IACpE,KAAK,EAAE,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,IAAI,CAAC,yBAAW,CAAC,KAAM,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC;CACzF,CAAC","sourcesContent":["import type { TSESLint } from '@typescript-eslint/utils';\nimport { recommended } from './recommended';\n\nexport const onboarding: TSESLint.Linter.Config = {\n ...recommended,\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n rules: Object.fromEntries(Object.keys(recommended.rules!).map((rule) => [rule, 'warn'])),\n};\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recommended-requiring-type-checking.d.ts","sourceRoot":"","sources":["../../src/configs/recommended-requiring-type-checking.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEzD,eAAO,MAAM,gCAAgC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAM9D,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.recommendedRequiringTypeChecking = void 0;
|
|
4
|
+
exports.recommendedRequiringTypeChecking = {
|
|
5
|
+
plugins: ['@typescript-eslint'],
|
|
6
|
+
rules: {
|
|
7
|
+
'@typescript-eslint/consistent-type-imports': 'error',
|
|
8
|
+
'@typescript-eslint/consistent-type-exports': 'error',
|
|
9
|
+
},
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=recommended-requiring-type-checking.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recommended-requiring-type-checking.js","sourceRoot":"","sources":["../../src/configs/recommended-requiring-type-checking.ts"],"names":[],"mappings":";;;AAEa,QAAA,gCAAgC,GAA2B;IACtE,OAAO,EAAE,CAAC,oBAAoB,CAAC;IAC/B,KAAK,EAAE;QACL,4CAA4C,EAAE,OAAO;QACrD,4CAA4C,EAAE,OAAO;KACtD;CACF,CAAC","sourcesContent":["import type { TSESLint } from '@typescript-eslint/utils';\n\nexport const recommendedRequiringTypeChecking: TSESLint.Linter.Config = {\n plugins: ['@typescript-eslint'],\n rules: {\n '@typescript-eslint/consistent-type-imports': 'error',\n '@typescript-eslint/consistent-type-exports': 'error',\n },\n};\n"]}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare const recommended:
|
|
1
|
+
import type { TSESLint } from '@typescript-eslint/utils';
|
|
2
|
+
export declare const recommended: TSESLint.Linter.Config;
|
|
3
3
|
//# sourceMappingURL=recommended.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recommended.d.ts","sourceRoot":"","sources":["../../src/configs/recommended.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"recommended.d.ts","sourceRoot":"","sources":["../../src/configs/recommended.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEzD,eAAO,MAAM,WAAW,EAAE,QAAQ,CAAC,MAAM,CAAC,MAOzC,CAAC"}
|
|
@@ -7,8 +7,6 @@ exports.recommended = {
|
|
|
7
7
|
'@ms-cloudpack/no-unsupported-imports': 'error',
|
|
8
8
|
'@rnx-kit/no-const-enum': 'error',
|
|
9
9
|
'@rnx-kit/no-export-all': 'error',
|
|
10
|
-
'@typescript-eslint/consistent-type-imports': 'error',
|
|
11
|
-
'@typescript-eslint/consistent-type-exports': 'error',
|
|
12
10
|
},
|
|
13
11
|
};
|
|
14
12
|
//# sourceMappingURL=recommended.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recommended.js","sourceRoot":"","sources":["../../src/configs/recommended.ts"],"names":[],"mappings":";;;AAEa,QAAA,WAAW,
|
|
1
|
+
{"version":3,"file":"recommended.js","sourceRoot":"","sources":["../../src/configs/recommended.ts"],"names":[],"mappings":";;;AAEa,QAAA,WAAW,GAA2B;IACjD,OAAO,EAAE,CAAC,eAAe,EAAE,UAAU,EAAE,oBAAoB,CAAC;IAC5D,KAAK,EAAE;QACL,sCAAsC,EAAE,OAAO;QAC/C,wBAAwB,EAAE,OAAO;QACjC,wBAAwB,EAAE,OAAO;KAClC;CACF,CAAC","sourcesContent":["import type { TSESLint } from '@typescript-eslint/utils';\n\nexport const recommended: TSESLint.Linter.Config = {\n plugins: ['@ms-cloudpack', '@rnx-kit', '@typescript-eslint'],\n rules: {\n '@ms-cloudpack/no-unsupported-imports': 'error',\n '@rnx-kit/no-const-enum': 'error',\n '@rnx-kit/no-export-all': 'error',\n },\n};\n"]}
|
package/lib/index.d.ts
CHANGED
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
recommended: import("eslint").ESLint.ConfigData<import("eslint").Linter.RulesRecord>;
|
|
5
|
-
};
|
|
6
|
-
rules: {
|
|
7
|
-
'no-unsupported-imports': import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<import("./rules/no-unsupported-imports").MessageIds, import("./rules/no-unsupported-imports").RawRuleOptions[], import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleListener>;
|
|
8
|
-
};
|
|
9
|
-
};
|
|
10
|
-
export = _default;
|
|
1
|
+
import type { TSESLint } from '@typescript-eslint/utils';
|
|
2
|
+
declare const plugin: TSESLint.Linter.Plugin;
|
|
3
|
+
export = plugin;
|
|
11
4
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAOzD,QAAA,MAAM,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAU7B,CAAC;AAEF,SAAS,MAAM,CAAC"}
|
package/lib/index.js
CHANGED
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const onboarding_1 = require("./configs/onboarding");
|
|
3
|
+
const onboarding_requiring_type_checking_1 = require("./configs/onboarding-requiring-type-checking");
|
|
3
4
|
const recommended_1 = require("./configs/recommended");
|
|
5
|
+
const recommended_requiring_type_checking_1 = require("./configs/recommended-requiring-type-checking");
|
|
4
6
|
const no_unsupported_imports_1 = require("./rules/no-unsupported-imports");
|
|
5
|
-
|
|
7
|
+
const plugin = {
|
|
6
8
|
configs: {
|
|
7
9
|
onboarding: onboarding_1.onboarding,
|
|
10
|
+
'onboarding-requiring-type-checking': onboarding_requiring_type_checking_1.onboardingRequiringTypeChecking,
|
|
8
11
|
recommended: recommended_1.recommended,
|
|
12
|
+
'recommended-requiring-type-checking': recommended_requiring_type_checking_1.recommendedRequiringTypeChecking,
|
|
9
13
|
},
|
|
10
14
|
rules: {
|
|
11
15
|
'no-unsupported-imports': no_unsupported_imports_1.rule,
|
|
12
16
|
},
|
|
13
17
|
};
|
|
18
|
+
module.exports = plugin;
|
|
14
19
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,qDAAkD;AAClD,qGAA+F;AAC/F,uDAAoD;AACpD,uGAAiG;AACjG,2EAA8E;AAE9E,MAAM,MAAM,GAA2B;IACrC,OAAO,EAAE;QACP,UAAU,EAAV,uBAAU;QACV,oCAAoC,EAAE,oEAA+B;QACrE,WAAW,EAAX,yBAAW;QACX,qCAAqC,EAAE,sEAAgC;KACxE;IACD,KAAK,EAAE;QACL,wBAAwB,EAAE,6BAAoB;KAC/C;CACF,CAAC;AAEF,iBAAS,MAAM,CAAC","sourcesContent":["import type { TSESLint } from '@typescript-eslint/utils';\nimport { onboarding } from './configs/onboarding';\nimport { onboardingRequiringTypeChecking } from './configs/onboarding-requiring-type-checking';\nimport { recommended } from './configs/recommended';\nimport { recommendedRequiringTypeChecking } from './configs/recommended-requiring-type-checking';\nimport { rule as noUnsupportedImports } from './rules/no-unsupported-imports';\n\nconst plugin: TSESLint.Linter.Plugin = {\n configs: {\n onboarding,\n 'onboarding-requiring-type-checking': onboardingRequiringTypeChecking,\n recommended,\n 'recommended-requiring-type-checking': recommendedRequiringTypeChecking,\n },\n rules: {\n 'no-unsupported-imports': noUnsupportedImports,\n },\n};\n// This export format is required for ESLint plugins\nexport = plugin;\n"]}
|
package/package.json
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ms-cloudpack/eslint-plugin",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "A set of ESLint rules for Cloudpack",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
|
+
"type": "commonjs",
|
|
7
8
|
"scripts": {
|
|
8
9
|
"build:watch": "cloudpack-scripts build-watch",
|
|
9
10
|
"build": "cloudpack-scripts build",
|
|
@@ -13,7 +14,7 @@
|
|
|
13
14
|
"test": "cloudpack-scripts test"
|
|
14
15
|
},
|
|
15
16
|
"dependencies": {
|
|
16
|
-
"@rnx-kit/eslint-plugin": "^0.4.
|
|
17
|
+
"@rnx-kit/eslint-plugin": "^0.4.2",
|
|
17
18
|
"@typescript-eslint/eslint-plugin": "^5.0.0",
|
|
18
19
|
"@typescript-eslint/parser": "^5.0.0",
|
|
19
20
|
"resolve": "^1.22.0"
|
|
@@ -22,12 +23,11 @@
|
|
|
22
23
|
"eslint": ">=7.0.0"
|
|
23
24
|
},
|
|
24
25
|
"devDependencies": {
|
|
25
|
-
"@ms-cloudpack/eslint-
|
|
26
|
+
"@ms-cloudpack/eslint-plugin-internal": "*",
|
|
26
27
|
"@ms-cloudpack/scripts": "*",
|
|
27
28
|
"@ms-cloudpack/test-utilities": "*",
|
|
28
|
-
"@
|
|
29
|
-
"@types/resolve": "1.20.2"
|
|
30
|
-
"@typescript-eslint/utils": "5.57.1"
|
|
29
|
+
"@typescript-eslint/utils": "^5.16.0",
|
|
30
|
+
"@types/resolve": "^1.20.2"
|
|
31
31
|
},
|
|
32
32
|
"files": [
|
|
33
33
|
"lib/**/!(*.test.*)"
|