@ms-cloudpack/eslint-plugin 0.1.2 → 0.2.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/README.md +14 -2
- package/lib/configs/onboarding.d.ts +3 -0
- package/lib/configs/onboarding.d.ts.map +1 -0
- package/lib/configs/onboarding.js +10 -0
- package/lib/configs/onboarding.js.map +1 -0
- package/lib/configs/recommended.d.ts.map +1 -1
- package/lib/configs/recommended.js +5 -1
- package/lib/configs/recommended.js.map +1 -1
- package/lib/index.d.ts +2 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +6 -4
- package/lib/index.js.map +1 -1
- package/package.json +4 -3
package/README.md
CHANGED
|
@@ -2,7 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
`@ms-cloudpack/eslint-plugin` provides a shared config and custom rules to help encourage Cloudpack-friendly coding practices, specifically regarding imports and exports.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Included configs
|
|
6
|
+
|
|
7
|
+
### Recommended
|
|
8
|
+
|
|
9
|
+
This config includes rules that are recommended for helping Cloudpack work better in your repo.
|
|
6
10
|
|
|
7
11
|
To enable the `@ms-cloudpack/recommended` configuration, add it to your ESLint config file:
|
|
8
12
|
|
|
@@ -13,9 +17,17 @@ To enable the `@ms-cloudpack/recommended` configuration, add it to your ESLint c
|
|
|
13
17
|
}
|
|
14
18
|
```
|
|
15
19
|
|
|
16
|
-
`@ms-cloudpack/recommended` currently includes the following rules
|
|
20
|
+
`@ms-cloudpack/recommended` currently includes the following rules.
|
|
17
21
|
|
|
18
22
|
- `@ms-cloudpack/no-unsupported-imports`
|
|
23
|
+
- [`@rnx-kit/no-const-enum](https://www.npmjs.com/package/@rnx-kit/eslint-plugin)
|
|
24
|
+
- [`@rnx-kit/no-export-all](https://www.npmjs.com/package/@rnx-kit/eslint-plugin)
|
|
25
|
+
- [`@typescript-eslint/consistent-type-exports`](https://typescript-eslint.io/rules/consistent-type-exports)
|
|
26
|
+
- [`@typescript-eslint/consistent-type-imports`](https://typescript-eslint.io/rules/consistent-type-imports)
|
|
27
|
+
|
|
28
|
+
### Onboarding
|
|
29
|
+
|
|
30
|
+
The `@ms-cloudpack/onboarding` config includes the same rules as `@ms-cloudpack/recommended`, but at `warn` level.
|
|
19
31
|
|
|
20
32
|
## Included rules
|
|
21
33
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"onboarding.d.ts","sourceRoot":"","sources":["../../src/configs/onboarding.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGrC,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,UAI/B,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.onboarding = void 0;
|
|
4
|
+
const recommended_1 = require("./recommended");
|
|
5
|
+
exports.onboarding = {
|
|
6
|
+
plugins: ['@ms-cloudpack', '@rnx-kit', '@typescript-eslint'],
|
|
7
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
8
|
+
rules: Object.fromEntries(Object.keys(recommended_1.recommended.rules).map((rule) => [rule, 'warn'])),
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=onboarding.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"onboarding.js","sourceRoot":"","sources":["../../src/configs/onboarding.ts"],"names":[],"mappings":";;;AACA,+CAA4C;AAE/B,QAAA,UAAU,GAAsB;IAC3C,OAAO,EAAE,CAAC,eAAe,EAAE,UAAU,EAAE,oBAAoB,CAAC;IAC5D,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 plugins: ['@ms-cloudpack', '@rnx-kit', '@typescript-eslint'],\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"]}
|
|
@@ -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,UAShC,CAAC"}
|
|
@@ -2,9 +2,13 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.recommended = void 0;
|
|
4
4
|
exports.recommended = {
|
|
5
|
-
plugins: ['@ms-cloudpack', '@typescript-eslint'],
|
|
5
|
+
plugins: ['@ms-cloudpack', '@rnx-kit', '@typescript-eslint'],
|
|
6
6
|
rules: {
|
|
7
7
|
'@ms-cloudpack/no-unsupported-imports': 'error',
|
|
8
|
+
'@rnx-kit/no-const-enum': 'error',
|
|
9
|
+
'@rnx-kit/no-export-all': 'error',
|
|
10
|
+
'@typescript-eslint/consistent-type-imports': 'error',
|
|
11
|
+
'@typescript-eslint/consistent-type-exports': 'error',
|
|
8
12
|
},
|
|
9
13
|
};
|
|
10
14
|
//# 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,oBAAoB,CAAC;
|
|
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;QACjC,4CAA4C,EAAE,OAAO;QACrD,4CAA4C,EAAE,OAAO;KACtD;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 '@typescript-eslint/consistent-type-imports': 'error',\n '@typescript-eslint/consistent-type-exports': 'error',\n },\n};\n"]}
|
package/lib/index.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
declare const _default: {
|
|
2
2
|
configs: {
|
|
3
|
+
onboarding: import("eslint").ESLint.ConfigData<import("eslint").Linter.RulesRecord>;
|
|
3
4
|
recommended: import("eslint").ESLint.ConfigData<import("eslint").Linter.RulesRecord>;
|
|
4
5
|
};
|
|
5
6
|
rules: {
|
|
6
|
-
'no-unsupported-imports': import("@typescript-eslint/utils/dist/ts-eslint/Rule
|
|
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>;
|
|
7
8
|
};
|
|
8
9
|
};
|
|
9
10
|
export = _default;
|
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":";;;;;;;;;AAIA,kBAQE"}
|
package/lib/index.js
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const
|
|
3
|
-
const
|
|
2
|
+
const onboarding_1 = require("./configs/onboarding");
|
|
3
|
+
const recommended_1 = require("./configs/recommended");
|
|
4
|
+
const no_unsupported_imports_1 = require("./rules/no-unsupported-imports");
|
|
4
5
|
module.exports = {
|
|
5
6
|
configs: {
|
|
6
|
-
|
|
7
|
+
onboarding: onboarding_1.onboarding,
|
|
8
|
+
recommended: recommended_1.recommended,
|
|
7
9
|
},
|
|
8
10
|
rules: {
|
|
9
|
-
'no-unsupported-imports':
|
|
11
|
+
'no-unsupported-imports': no_unsupported_imports_1.rule,
|
|
10
12
|
},
|
|
11
13
|
};
|
|
12
14
|
//# 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":";AAAA,
|
|
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;KACZ;IACD,KAAK,EAAE;QACL,wBAAwB,EAAE,6BAAoB;KAC/C;CACF,CAAC","sourcesContent":["import { onboarding } from './configs/onboarding';\nimport { recommended } from './configs/recommended';\nimport { rule as noUnsupportedImports } from './rules/no-unsupported-imports';\n\nexport = {\n configs: {\n onboarding,\n recommended,\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.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "A set of ESLint rules for Cloudpack",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -13,12 +13,13 @@
|
|
|
13
13
|
"test": "cloudpack-scripts test"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
+
"@rnx-kit/eslint-plugin": "^0.4.0",
|
|
16
17
|
"@typescript-eslint/eslint-plugin": "^5.0.0",
|
|
17
18
|
"@typescript-eslint/parser": "^5.0.0",
|
|
18
19
|
"resolve": "^1.22.0"
|
|
19
20
|
},
|
|
20
21
|
"peerDependencies": {
|
|
21
|
-
"eslint": ">=
|
|
22
|
+
"eslint": ">=7.0.0"
|
|
22
23
|
},
|
|
23
24
|
"devDependencies": {
|
|
24
25
|
"@ms-cloudpack/eslint-config-base": "*",
|
|
@@ -26,7 +27,7 @@
|
|
|
26
27
|
"@ms-cloudpack/test-utilities": "*",
|
|
27
28
|
"@types/eslint": "8.37.0",
|
|
28
29
|
"@types/resolve": "1.20.2",
|
|
29
|
-
"@typescript-eslint/utils": "5.
|
|
30
|
+
"@typescript-eslint/utils": "5.57.1"
|
|
30
31
|
},
|
|
31
32
|
"files": [
|
|
32
33
|
"lib/**/!(*.test.*)"
|