@ms-cloudpack/eslint-plugin 0.2.0 → 0.2.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/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.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.map +1 -1
- package/lib/configs/recommended.js +0 -2
- package/lib/configs/recommended.js.map +1 -1
- package/lib/index.d.ts +2 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +4 -0
- package/lib/index.js.map +1 -1
- package/package.json +2 -2
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,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGrC,eAAO,MAAM,+BAA+B,EAAE,MAAM,CAAC,UAIpD,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,GAAsB;IAChE,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 { ESLint } from 'eslint';\nimport { recommendedRequiringTypeChecking } from './recommended-requiring-type-checking';\n\nexport const onboardingRequiringTypeChecking: ESLint.ConfigData = {\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"]}
|
|
@@ -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,GAAsB;IAC3C,
|
|
1
|
+
{"version":3,"file":"onboarding.js","sourceRoot":"","sources":["../../src/configs/onboarding.ts"],"names":[],"mappings":";;;AACA,+CAA4C;AAE/B,QAAA,UAAU,GAAsB;IAC3C,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 { ESLint } from 'eslint';\nimport { recommended } from './recommended';\n\nexport const onboarding: ESLint.ConfigData = {\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,MAAM,EAAE,MAAM,QAAQ,CAAC;AAErC,eAAO,MAAM,gCAAgC,EAAE,MAAM,CAAC,UAMrD,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,GAAsB;IACjE,OAAO,EAAE,CAAC,oBAAoB,CAAC;IAC/B,KAAK,EAAE;QACL,4CAA4C,EAAE,OAAO;QACrD,4CAA4C,EAAE,OAAO;KACtD;CACF,CAAC","sourcesContent":["import type { ESLint } from 'eslint';\n\nexport const recommendedRequiringTypeChecking: ESLint.ConfigData = {\n plugins: ['@typescript-eslint'],\n rules: {\n '@typescript-eslint/consistent-type-imports': 'error',\n '@typescript-eslint/consistent-type-exports': 'error',\n },\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recommended.d.ts","sourceRoot":"","sources":["../../src/configs/recommended.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAErC,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"recommended.d.ts","sourceRoot":"","sources":["../../src/configs/recommended.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAErC,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,UAOhC,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,GAAsB;IAC5C,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;
|
|
1
|
+
{"version":3,"file":"recommended.js","sourceRoot":"","sources":["../../src/configs/recommended.ts"],"names":[],"mappings":";;;AAEa,QAAA,WAAW,GAAsB;IAC5C,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 { ESLint } from 'eslint';\n\nexport const recommended: ESLint.ConfigData = {\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,7 +1,9 @@
|
|
|
1
1
|
declare const _default: {
|
|
2
2
|
configs: {
|
|
3
3
|
onboarding: import("eslint").ESLint.ConfigData<import("eslint").Linter.RulesRecord>;
|
|
4
|
+
'onboarding-requiring-type-checking': import("eslint").ESLint.ConfigData<import("eslint").Linter.RulesRecord>;
|
|
4
5
|
recommended: import("eslint").ESLint.ConfigData<import("eslint").Linter.RulesRecord>;
|
|
6
|
+
'recommended-requiring-type-checking': import("eslint").ESLint.ConfigData<import("eslint").Linter.RulesRecord>;
|
|
5
7
|
};
|
|
6
8
|
rules: {
|
|
7
9
|
'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>;
|
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":";;;;;;;;;;;AAMA,kBAUE"}
|
package/lib/index.js
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
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
|
module.exports = {
|
|
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,
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA,qDAAkD;AAClD,uDAAoD;AACpD,2EAA8E;AAE9E,iBAAS;IACP,OAAO,EAAE;QACP,UAAU,EAAV,uBAAU;QACV,WAAW,EAAX,yBAAW;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA,qDAAkD;AAClD,qGAA+F;AAC/F,uDAAoD;AACpD,uGAAiG;AACjG,2EAA8E;AAE9E,iBAAS;IACP,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","sourcesContent":["import { 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\nexport = {\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"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ms-cloudpack/eslint-plugin",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "A set of ESLint rules for Cloudpack",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"test": "cloudpack-scripts test"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@rnx-kit/eslint-plugin": "^0.4.
|
|
16
|
+
"@rnx-kit/eslint-plugin": "^0.4.2",
|
|
17
17
|
"@typescript-eslint/eslint-plugin": "^5.0.0",
|
|
18
18
|
"@typescript-eslint/parser": "^5.0.0",
|
|
19
19
|
"resolve": "^1.22.0"
|