@ms-cloudpack/eslint-plugin-deprecated 0.1.3 → 0.1.4
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 +20 -0
- package/lib/index.d.ts +35 -5
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +14 -7
- package/lib/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -13,3 +13,23 @@ Forbids the use of deprecated APIs.
|
|
|
13
13
|
Options:
|
|
14
14
|
|
|
15
15
|
- `ignoredSelectors` (optional): Ignore deprecated APIs matching these selectors, using [esquery syntax](https://github.com/estools/esquery).
|
|
16
|
+
|
|
17
|
+
## Configs
|
|
18
|
+
|
|
19
|
+
The plugin exports two configs:
|
|
20
|
+
|
|
21
|
+
- `base`: Just define the plugin
|
|
22
|
+
- `recommended`: Define the plugin and enable `@ms-cloudpack/no-deprecated` with empty options
|
|
23
|
+
|
|
24
|
+
Usage:
|
|
25
|
+
|
|
26
|
+
```js
|
|
27
|
+
import defineConfig from 'eslint/config';
|
|
28
|
+
import cloudpack from '@ms-cloudpack/eslint-plugin-deprecated';
|
|
29
|
+
|
|
30
|
+
export default defineConfig(
|
|
31
|
+
// ... typed linting setup and other configs ...
|
|
32
|
+
// https://typescript-eslint.io/linting/typed-linting
|
|
33
|
+
cloudpack.configs.recommended, // or .base
|
|
34
|
+
);
|
|
35
|
+
```
|
package/lib/index.d.ts
CHANGED
|
@@ -1,17 +1,47 @@
|
|
|
1
1
|
import type { TSESLint } from '@typescript-eslint/utils';
|
|
2
2
|
declare const plugin: {
|
|
3
|
-
meta: {
|
|
4
|
-
name: string;
|
|
5
|
-
version: string;
|
|
6
|
-
namespace: string;
|
|
7
|
-
};
|
|
8
3
|
configs: {
|
|
4
|
+
base: {
|
|
5
|
+
plugins: {
|
|
6
|
+
'@ms-cloudpack': {
|
|
7
|
+
meta: {
|
|
8
|
+
name: string;
|
|
9
|
+
version: string;
|
|
10
|
+
namespace: string;
|
|
11
|
+
};
|
|
12
|
+
rules: {
|
|
13
|
+
'@ms-cloudpack/no-deprecated': TSESLint.RuleModule<"forbidden", [({
|
|
14
|
+
ignoredSelectors?: string[];
|
|
15
|
+
} | undefined)?], unknown, TSESLint.RuleListener>;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
};
|
|
9
20
|
recommended: {
|
|
21
|
+
plugins: {
|
|
22
|
+
'@ms-cloudpack': {
|
|
23
|
+
meta: {
|
|
24
|
+
name: string;
|
|
25
|
+
version: string;
|
|
26
|
+
namespace: string;
|
|
27
|
+
};
|
|
28
|
+
rules: {
|
|
29
|
+
'@ms-cloudpack/no-deprecated': TSESLint.RuleModule<"forbidden", [({
|
|
30
|
+
ignoredSelectors?: string[];
|
|
31
|
+
} | undefined)?], unknown, TSESLint.RuleListener>;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
};
|
|
10
35
|
rules: {
|
|
11
36
|
'@ms-cloudpack/no-deprecated': "error";
|
|
12
37
|
};
|
|
13
38
|
};
|
|
14
39
|
};
|
|
40
|
+
meta: {
|
|
41
|
+
name: string;
|
|
42
|
+
version: string;
|
|
43
|
+
namespace: string;
|
|
44
|
+
};
|
|
15
45
|
rules: {
|
|
16
46
|
'@ms-cloudpack/no-deprecated': TSESLint.RuleModule<"forbidden", [({
|
|
17
47
|
ignoredSelectors?: string[];
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAoBzD,QAAA,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAU0B,CAAC;AAEvC,eAAe,MAAM,CAAC"}
|
package/lib/index.js
CHANGED
|
@@ -2,18 +2,25 @@ import fs from 'fs';
|
|
|
2
2
|
import path from 'path';
|
|
3
3
|
import noDeprecated from "./rules/no-deprecated.js";
|
|
4
4
|
const { name, version } = JSON.parse(fs.readFileSync(path.resolve(import.meta.dirname, '../package.json'), 'utf8'));
|
|
5
|
-
const
|
|
5
|
+
const basePlugin = {
|
|
6
6
|
meta: { name, version, namespace: '@ms-cloudpack' },
|
|
7
|
+
rules: {
|
|
8
|
+
'@ms-cloudpack/no-deprecated': noDeprecated,
|
|
9
|
+
},
|
|
10
|
+
// Use `satisfies` to preserve the original property names
|
|
11
|
+
};
|
|
12
|
+
const plugins = {
|
|
13
|
+
'@ms-cloudpack': basePlugin,
|
|
14
|
+
};
|
|
15
|
+
const plugin = {
|
|
16
|
+
...basePlugin,
|
|
7
17
|
configs: {
|
|
18
|
+
base: { plugins },
|
|
8
19
|
recommended: {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
},
|
|
20
|
+
plugins,
|
|
21
|
+
rules: { '@ms-cloudpack/no-deprecated': 'error' },
|
|
12
22
|
},
|
|
13
23
|
},
|
|
14
|
-
rules: {
|
|
15
|
-
'@ms-cloudpack/no-deprecated': noDeprecated,
|
|
16
|
-
},
|
|
17
24
|
// Use `satisfies` to preserve the original property names
|
|
18
25
|
};
|
|
19
26
|
export default plugin;
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,YAAY,MAAM,0BAA0B,CAAC;AAEpD,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,iBAAiB,CAAC,EAAE,MAAM,CAAC,CAGjH,CAAC;AAEF,MAAM,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,YAAY,MAAM,0BAA0B,CAAC;AAEpD,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,iBAAiB,CAAC,EAAE,MAAM,CAAC,CAGjH,CAAC;AAEF,MAAM,UAAU,GAAG;IACjB,IAAI,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE;IACnD,KAAK,EAAE;QACL,6BAA6B,EAAE,YAAY;KAC5C;IACD,0DAA0D;CACtB,CAAC;AAEvC,MAAM,OAAO,GAAG;IACd,eAAe,EAAE,UAAU;CAC5B,CAAC;AAEF,MAAM,MAAM,GAAG;IACb,GAAG,UAAU;IACb,OAAO,EAAE;QACP,IAAI,EAAE,EAAE,OAAO,EAAE;QACjB,WAAW,EAAE;YACX,OAAO;YACP,KAAK,EAAE,EAAE,6BAA6B,EAAE,OAAO,EAAE;SAClD;KACF;IACD,0DAA0D;CACtB,CAAC;AAEvC,eAAe,MAAM,CAAC","sourcesContent":["import fs from 'fs';\nimport path from 'path';\nimport type { TSESLint } from '@typescript-eslint/utils';\nimport noDeprecated from './rules/no-deprecated.ts';\n\nconst { name, version } = JSON.parse(fs.readFileSync(path.resolve(import.meta.dirname, '../package.json'), 'utf8')) as {\n name: string;\n version: string;\n};\n\nconst basePlugin = {\n meta: { name, version, namespace: '@ms-cloudpack' },\n rules: {\n '@ms-cloudpack/no-deprecated': noDeprecated,\n },\n // Use `satisfies` to preserve the original property names\n} satisfies TSESLint.FlatConfig.Plugin;\n\nconst plugins = {\n '@ms-cloudpack': basePlugin,\n};\n\nconst plugin = {\n ...basePlugin,\n configs: {\n base: { plugins },\n recommended: {\n plugins,\n rules: { '@ms-cloudpack/no-deprecated': 'error' },\n },\n },\n // Use `satisfies` to preserve the original property names\n} satisfies TSESLint.FlatConfig.Plugin;\n\nexport default plugin;\n"]}
|