eslint-plugin-ts-type-forge 0.8.5 → 0.8.7
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 +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/plugin.d.mts +1 -1
- package/dist/plugin.d.mts.map +1 -1
- package/dist/plugin.mjs +1 -0
- package/dist/plugin.mjs.map +1 -1
- package/dist/rule-types.d.mts +4 -4
- package/dist/rule-types.d.mts.map +1 -1
- package/dist/rules/import-style.d.mts +1 -1
- package/dist/rules/import-style.d.mts.map +1 -1
- package/dist/rules/no-side-effect-import.d.mts +1 -1
- package/dist/rules/no-side-effect-import.d.mts.map +1 -1
- package/dist/rules/prefer-canonical-length-constrained-tuple.d.mts +1 -1
- package/dist/rules/prefer-canonical-length-constrained-tuple.d.mts.map +1 -1
- package/dist/rules/prefer-readonly-or-mutable-record.d.mts +1 -1
- package/dist/rules/prefer-readonly-or-mutable-record.d.mts.map +1 -1
- package/dist/rules/prefer-strict-or-relaxed-utility-type.d.mts +1 -1
- package/dist/rules/prefer-strict-or-relaxed-utility-type.d.mts.map +1 -1
- package/dist/rules/rewrite-rule-utils.d.mts +1 -1
- package/dist/rules/rewrite-rule-utils.d.mts.map +1 -1
- package/dist/types.d.mts +2 -2
- package/dist/types.d.mts.map +1 -1
- package/package.json +9 -9
- package/src/index.mts +1 -1
- package/src/plugin.mts +4 -3
- package/src/plugin.test.mts +0 -13
- package/src/rule-types.mts +4 -4
- package/src/rules/import-style.mts +1 -1
- package/src/rules/no-side-effect-import.mts +1 -1
- package/src/rules/prefer-canonical-length-constrained-tuple.mts +1 -1
- package/src/rules/prefer-readonly-or-mutable-record.mts +1 -1
- package/src/rules/prefer-strict-or-relaxed-utility-type.mts +1 -1
- package/src/rules/rewrite-rule-utils.mts +1 -1
- package/src/rules/rules.mts +1 -1
- package/src/types.mts +2 -2
package/README.md
CHANGED
|
@@ -227,7 +227,7 @@ sitting in a file that type-checks.
|
|
|
227
227
|
import 'ts-type-forge';
|
|
228
228
|
|
|
229
229
|
// ✅ types are reached by name
|
|
230
|
-
import {
|
|
230
|
+
import type { NonEmptyArray } from 'ts-type-forge';
|
|
231
231
|
```
|
|
232
232
|
|
|
233
233
|
The fix deletes the import along with its line. Only the bare specifier matches:
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { eslintPluginTsTypeForge } from './plugin.mjs';
|
|
2
2
|
export type { EslintTsTypeForgeRules, EslintTsTypeForgeRulesOption, } from './rule-types.mjs';
|
|
3
3
|
export { tsTypeForgeRules } from './rules/index.mjs';
|
|
4
|
-
export {
|
|
4
|
+
export type { ESLintFlatConfig, ESLintPlugin } from './types.mjs';
|
|
5
5
|
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../src/index.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AACvD,YAAY,EACV,sBAAsB,EACtB,4BAA4B,GAC7B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../src/index.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AACvD,YAAY,EACV,sBAAsB,EACtB,4BAA4B,GAC7B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,YAAY,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC"}
|
package/dist/plugin.d.mts
CHANGED
package/dist/plugin.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.mts","sourceRoot":"","sources":["../src/plugin.mts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"plugin.d.mts","sourceRoot":"","sources":["../src/plugin.mts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAoB,YAAY,EAAE,MAAM,aAAa,CAAC;AAmClE,eAAO,MAAM,uBAAuB;;iBAEhC,IAAI,EAAE,6BAA6B;;;;;;;;;;;;;;;;;;;QAInC,oDAAoD;iBACpD,WAAW;2BAtBP,2BAA2B;;yBAQ3B,eAAe,EAAI,YAAY;;;gEAlBE,OAAO;oFACa,OAAO;0EACjB,OAAO;4EACL,OAAO;gFACH,OAAO;;;;CA8B/B,CAAC"}
|
package/dist/plugin.mjs
CHANGED
package/dist/plugin.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.mjs","sourceRoot":"","sources":["../src/plugin.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAGrD
|
|
1
|
+
{"version":3,"file":"plugin.mjs","sourceRoot":"","sources":["../src/plugin.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAGrD;;;;;;GAMG;AACH,MAAM,gBAAgB,GAAG;IACvB,qCAAqC,EAAE,OAAO;IAC9C,yDAAyD,EAAE,OAAO;IAClE,+CAA+C,EAAE,OAAO;IACxD,iDAAiD,EAAE,OAAO;IAC1D,qDAAqD,EAAE,OAAO;CAG/D,CAAC;AAEF,MAAM,iBAAiB,GAAG;IACxB,IAAI,EAAE,2BAA2B;IACjC,OAAO,EAAE;QACP,uEAAuE;QACvE,yEAAyE;QACzE,wEAAwE;QACxE,mDAAmD;QACnD,0EAA0E;QAC1E,wDAAwD;QACxD,IAAI,eAAe;YACjB,OAAO,uBAAuB,CAAC;QACjC,CAAC;KACF;IACD,KAAK,EAAE,gBAAgB;CACY,CAAC;AAEtC,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC,IAAI,EAAE;QACJ,IAAI,EAAE,6BAA6B;KACpC;IACD,KAAK,EAAE,gBAAgB;IACvB,OAAO,EAAE;QACP,oDAAoD;QACpD,WAAW,EAAE,iBAAiB;KAC/B;CAC8B,CAAC"}
|
package/dist/rule-types.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import type { TSESLint } from '@typescript-eslint/utils';
|
|
2
|
+
import type { Linter } from 'eslint';
|
|
3
|
+
import type { TypeEq } from 'ts-type-forge';
|
|
4
|
+
import type { tsTypeForgeRules } from './rules/index.mjs';
|
|
5
5
|
type SpreadOptionsIfIsArray<T extends readonly [Linter.StringSeverity, unknown]> = T[1] extends readonly unknown[] ? readonly [Linter.StringSeverity, ...T[1]] : T;
|
|
6
6
|
/**
|
|
7
7
|
* Extracts the options tuple type of a rule from its TypeScript
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rule-types.d.mts","sourceRoot":"","sources":["../src/rule-types.mts"],"names":[],"mappings":"AAKA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"rule-types.d.mts","sourceRoot":"","sources":["../src/rule-types.mts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACrC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAE1D,KAAK,sBAAsB,CACzB,CAAC,SAAS,SAAS,CAAC,MAAM,CAAC,cAAc,EAAE,OAAO,CAAC,IACjD,CAAC,CAAC,CAAC,CAAC,SAAS,SAAS,OAAO,EAAE,GAC/B,SAAS,CAAC,MAAM,CAAC,cAAc,EAAE,GAAG,CAAC,CAAC,CA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
|
1
|
+
import type { TSESLint, TSESTree } from '@typescript-eslint/utils';
|
|
2
2
|
/** `JSONSchema4`, reached through the public rule-module types. */
|
|
3
3
|
type JsonSchema = Exclude<TSESLint.RuleModule<string, readonly unknown[]>['meta']['schema'], readonly unknown[]>;
|
|
4
4
|
export type ImportStyle = 'global' | 'named';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"import-style.d.mts","sourceRoot":"","sources":["../../src/rules/import-style.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"import-style.d.mts","sourceRoot":"","sources":["../../src/rules/import-style.mts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAUnE,mEAAmE;AACnE,KAAK,UAAU,GAAG,OAAO,CACvB,QAAQ,CAAC,UAAU,CAAC,MAAM,EAAE,SAAS,OAAO,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,EACjE,SAAS,OAAO,EAAE,CACnB,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG,QAAQ,GAAG,OAAO,CAAC;AAE7C,eAAO,MAAM,oBAAoB,EAAE,WAAqB,CAAC;AAEzD,eAAO,MAAM,4BAA4B,EAAE,UAW1C,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,eAAe,YACjB,QAAQ,CAAC,OAAO,iBACV,MAAM,eACR,WAAW,KACvB,QAAQ,CAAC;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,OAAO,CAAA;CAAE,CAAC,GAAG,SAW1D,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"no-side-effect-import.d.mts","sourceRoot":"","sources":["../../src/rules/no-side-effect-import.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"no-side-effect-import.d.mts","sourceRoot":"","sources":["../../src/rules/no-side-effect-import.mts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAY,MAAM,0BAA0B,CAAC;AAInE,KAAK,OAAO,GAAG,SAAS,EAAE,CAAC;AAE3B,KAAK,UAAU,GAAG,wBAAwB,CAAC;AAE3C;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,UAAU,CAAC,UAAU,EAAE,OAAO,CA8B9D,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prefer-canonical-length-constrained-tuple.d.mts","sourceRoot":"","sources":["../../src/rules/prefer-canonical-length-constrained-tuple.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"prefer-canonical-length-constrained-tuple.d.mts","sourceRoot":"","sources":["../../src/rules/prefer-canonical-length-constrained-tuple.mts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAiBzD,KAAK,OAAO,GAAG,SAAS;IACtB,QAAQ,CAAC;QACP,WAAW,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC;QACjC,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,CAAC,CAAC;CACJ,CAAC;AAEF,KAAK,UAAU,GAAG,mBAAmB,CAAC;AAQtC,eAAO,MAAM,qCAAqC,EAAE,QAAQ,CAAC,UAAU,CACrE,UAAU,EACV,OAAO,CAiFC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prefer-readonly-or-mutable-record.d.mts","sourceRoot":"","sources":["../../src/rules/prefer-readonly-or-mutable-record.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"prefer-readonly-or-mutable-record.d.mts","sourceRoot":"","sources":["../../src/rules/prefer-readonly-or-mutable-record.mts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAUzD,KAAK,OAAO,GAAG,SAAS;IACtB,QAAQ,CAAC;QACP,WAAW,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC;KAClC,CAAC,CAAC;CACJ,CAAC;AAEF,KAAK,UAAU,GAAG,4BAA4B,GAAG,aAAa,CAAC;AAW/D,eAAO,MAAM,6BAA6B,EAAE,QAAQ,CAAC,UAAU,CAC7D,UAAU,EACV,OAAO,CA4CC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prefer-strict-or-relaxed-utility-type.d.mts","sourceRoot":"","sources":["../../src/rules/prefer-strict-or-relaxed-utility-type.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"prefer-strict-or-relaxed-utility-type.d.mts","sourceRoot":"","sources":["../../src/rules/prefer-strict-or-relaxed-utility-type.mts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAUzD,KAAK,OAAO,GAAG,SAAS;IACtB,QAAQ,CAAC;QACP,WAAW,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC;KAClC,CAAC,CAAC;CACJ,CAAC;AAEF,KAAK,UAAU,GAAG,oBAAoB,GAAG,aAAa,CAAC;AAoBvD,eAAO,MAAM,gCAAgC,EAAE,QAAQ,CAAC,UAAU,CAChE,UAAU,EACV,OAAO,CAyCC,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { TSESLint, TSESTree } from '@typescript-eslint/utils';
|
|
2
2
|
import { type ImportStyle } from './import-style.mjs';
|
|
3
3
|
/** One deterministic replacement of a type node by a named ts-type-forge type. */
|
|
4
4
|
export type TypeRewrite = Readonly<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rewrite-rule-utils.d.mts","sourceRoot":"","sources":["../../src/rules/rewrite-rule-utils.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"rewrite-rule-utils.d.mts","sourceRoot":"","sources":["../../src/rules/rewrite-rule-utils.mts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEnE,OAAO,EAAmB,KAAK,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAKvE,kFAAkF;AAClF,MAAM,MAAM,WAAW,GAAG,QAAQ,CAAC;IACjC,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,sEAAsE;IACtE,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC,CAAC;AAEH;;;;;;;;GAQG;AACH,eAAO,MAAM,kBAAkB,GAAI,UAAU,SAAS,MAAM,WACjD,QAAQ,CAAC,WAAW,CAAC,UAAU,EAAE,SAAS,OAAO,EAAE,CAAC,YACnD,SAAS,WAAW,EAAE,aACrB,UAAU,eACR,WAAW,KACvB,IAqCF,CAAC"}
|
package/dist/types.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { TSESLint } from '@typescript-eslint/utils';
|
|
2
|
+
import type { DeepReadonly } from 'ts-type-forge';
|
|
3
3
|
export type ESLintPlugin = DeepReadonly<TSESLint.FlatConfig.Plugin>;
|
|
4
4
|
export type ESLintFlatConfig = DeepReadonly<TSESLint.FlatConfig.Config>;
|
|
5
5
|
//# sourceMappingURL=types.d.mts.map
|
package/dist/types.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.mts","sourceRoot":"","sources":["../src/types.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.mts","sourceRoot":"","sources":["../src/types.mts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAElD,MAAM,MAAM,YAAY,GAAG,YAAY,CAAC,QAAQ,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;AAEpE,MAAM,MAAM,gBAAgB,GAAG,YAAY,CAAC,QAAQ,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-ts-type-forge",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.7",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "ESLint rules that steer type declarations toward ts-type-forge idioms.",
|
|
6
6
|
"keywords": [
|
|
@@ -35,17 +35,17 @@
|
|
|
35
35
|
"LICENSE"
|
|
36
36
|
],
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@typescript-eslint/utils": "~8.
|
|
38
|
+
"@typescript-eslint/utils": "~8.71.1",
|
|
39
39
|
"ts-data-forge": "~14.7.1",
|
|
40
40
|
"ts-type-forge": "9.2.2"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@typescript-eslint/parser": "8.
|
|
44
|
-
"@typescript-eslint/rule-tester": "8.
|
|
43
|
+
"@typescript-eslint/parser": "8.71.1",
|
|
44
|
+
"@typescript-eslint/rule-tester": "8.71.1",
|
|
45
45
|
"dedent": "1.7.2",
|
|
46
|
-
"eslint-config-typed": "5.
|
|
47
|
-
"eslint-plugin-ts-data-forge": "0.8.
|
|
48
|
-
"eslint-plugin-ts-fortress": "1.2
|
|
46
|
+
"eslint-config-typed": "5.17.3",
|
|
47
|
+
"eslint-plugin-ts-data-forge": "0.8.5",
|
|
48
|
+
"eslint-plugin-ts-fortress": "1.3.2",
|
|
49
49
|
"prettier": "3.9.9",
|
|
50
50
|
"prettier-plugin-organize-imports": "4.3.0",
|
|
51
51
|
"prettier-plugin-packagejson": "3.0.2",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"scripts": {
|
|
67
67
|
"build": "tsx --tsconfig ../../tools/configs/tsconfig.tsx.json ./scripts/cmd/build.mts",
|
|
68
68
|
"check:ext": "tsx --tsconfig ../../tools/configs/tsconfig.tsx.json ./scripts/cmd/check-ext.mts",
|
|
69
|
-
"check:lint": "eslint .",
|
|
69
|
+
"check:lint": "oxlint . && eslint .",
|
|
70
70
|
"check:test": "pnpm run z:vitest run",
|
|
71
71
|
"check:test:cov": "pnpm run z:vitest run --coverage",
|
|
72
72
|
"check:types": "node ../../node_modules/typescript-native/bin/tsc --noEmit",
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
"fix:fmt": "tsx --tsconfig ../../tools/configs/tsconfig.tsx.json ../../libs/ts-repo-utils/src/cmd/format-uncommitted.mts --cwd .",
|
|
75
75
|
"fix:fmt:diff": "tsx --tsconfig ../../tools/configs/tsconfig.tsx.json ../../libs/ts-repo-utils/src/cmd/format-diff-from.mts origin/main --cwd .",
|
|
76
76
|
"fix:fmt:full": "pnpm run z:prettier .",
|
|
77
|
-
"fix:lint": "eslint . --fix",
|
|
77
|
+
"fix:lint": "oxlint . --fix && eslint . --fix",
|
|
78
78
|
"fmt": "pnpm run fix:fmt",
|
|
79
79
|
"gen": "run-s gen:rule-types gen:readme",
|
|
80
80
|
"gen:readme": "tsx --tsconfig ../../tools/configs/tsconfig.tsx.json ./scripts/cmd/embed-examples.mts",
|
package/src/index.mts
CHANGED
package/src/plugin.mts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { tsTypeForgeRules } from './rules/index.mjs';
|
|
2
|
-
import {
|
|
2
|
+
import type { ESLintFlatConfig, ESLintPlugin } from './types.mjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Every rule this plugin ships, at `error`.
|
|
6
6
|
*
|
|
7
|
-
* The `satisfies` clause below is keyed off {@link tsTypeForgeRules}, so
|
|
8
|
-
*
|
|
7
|
+
* The `satisfies` clause below is keyed off {@link tsTypeForgeRules}, so leaving a
|
|
8
|
+
* rule out, naming one that does not exist, or setting one to anything
|
|
9
|
+
* but `error` fails to type-check. That is the whole check; no test repeats it.
|
|
9
10
|
*/
|
|
10
11
|
const recommendedRules = {
|
|
11
12
|
'ts-type-forge/no-side-effect-import': 'error',
|
package/src/plugin.test.mts
CHANGED
|
@@ -1,21 +1,8 @@
|
|
|
1
1
|
import { eslintPluginTsTypeForge } from './plugin.mjs';
|
|
2
|
-
import { tsTypeForgeRules } from './rules/index.mjs';
|
|
3
2
|
|
|
4
3
|
describe('eslintPluginTsTypeForge.configs.recommended', () => {
|
|
5
4
|
const recommended = eslintPluginTsTypeForge.configs.recommended;
|
|
6
5
|
|
|
7
|
-
test('enables every rule of the plugin, and nothing else, at "error"', () => {
|
|
8
|
-
assert.deepStrictEqual(
|
|
9
|
-
recommended.rules,
|
|
10
|
-
Object.fromEntries(
|
|
11
|
-
Object.keys(tsTypeForgeRules).map((name) => [
|
|
12
|
-
`ts-type-forge/${name}`,
|
|
13
|
-
'error',
|
|
14
|
-
]),
|
|
15
|
-
),
|
|
16
|
-
);
|
|
17
|
-
});
|
|
18
|
-
|
|
19
6
|
test('registers the exported plugin object itself', () => {
|
|
20
7
|
// Registering a *copy* would make `Cannot redefine plugin` errors possible
|
|
21
8
|
// for users who also list the plugin in their own `plugins` record.
|
package/src/rule-types.mts
CHANGED
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
// This file is auto-generated by `pnpm run gen:rule-types`
|
|
4
4
|
// (`scripts/cmd/gen-rule-types.mts`). Do not edit it manually.
|
|
5
5
|
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
6
|
+
import type { TSESLint } from '@typescript-eslint/utils';
|
|
7
|
+
import type { Linter } from 'eslint';
|
|
8
|
+
import type { TypeEq } from 'ts-type-forge';
|
|
9
|
+
import type { tsTypeForgeRules } from './rules/index.mjs';
|
|
10
10
|
|
|
11
11
|
type SpreadOptionsIfIsArray<
|
|
12
12
|
T extends readonly [Linter.StringSeverity, unknown],
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { TSESLint, TSESTree } from '@typescript-eslint/utils';
|
|
2
2
|
import { Arr } from 'ts-data-forge';
|
|
3
3
|
import { resolveTypeName, type ImportStyle } from './import-style.mjs';
|
|
4
4
|
import { buildTypeImportFix } from './import-utils.mjs';
|
package/src/rules/rules.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { ESLintPlugin } from '../types.mjs';
|
|
2
2
|
import { noSideEffectImport } from './no-side-effect-import.mjs';
|
|
3
3
|
import { preferCanonicalLengthConstrainedTuple } from './prefer-canonical-length-constrained-tuple.mjs';
|
|
4
4
|
import { preferCanonicalMutableRecord } from './prefer-canonical-mutable-record.mjs';
|
package/src/types.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { TSESLint } from '@typescript-eslint/utils';
|
|
2
|
+
import type { DeepReadonly } from 'ts-type-forge';
|
|
3
3
|
|
|
4
4
|
export type ESLintPlugin = DeepReadonly<TSESLint.FlatConfig.Plugin>;
|
|
5
5
|
|