eslint-config-typed 3.6.0 → 3.7.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 +2 -2
- package/dist/configs/plugins.d.mts +1 -1
- package/dist/configs/plugins.d.mts.map +1 -1
- package/dist/configs/plugins.mjs +2 -2
- package/dist/configs/plugins.mjs.map +1 -1
- package/dist/configs/typescript.d.mts.map +1 -1
- package/dist/configs/typescript.mjs +2 -0
- package/dist/configs/typescript.mjs.map +1 -1
- package/dist/entry-point.d.mts +1 -1
- package/dist/entry-point.d.mts.map +1 -1
- package/dist/entry-point.mjs +1 -1
- package/dist/index.mjs +2 -1
- package/dist/index.mjs.map +1 -1
- package/dist/plugins/index.d.mts +1 -1
- package/dist/plugins/index.d.mts.map +1 -1
- package/dist/plugins/index.mjs +1 -1
- package/dist/plugins/ts-restrictions/index.d.mts +2 -0
- package/dist/plugins/ts-restrictions/index.d.mts.map +1 -0
- package/dist/plugins/ts-restrictions/index.mjs +2 -0
- package/dist/plugins/ts-restrictions/plugin.d.mts +3 -0
- package/dist/plugins/ts-restrictions/plugin.d.mts.map +1 -0
- package/dist/plugins/ts-restrictions/plugin.mjs +8 -0
- package/dist/plugins/ts-restrictions/plugin.mjs.map +1 -0
- package/dist/plugins/ts-restrictions/rules/index.d.mts.map +1 -0
- package/dist/plugins/ts-restrictions/rules/index.mjs +2 -0
- package/dist/plugins/ts-restrictions/rules/no-restricted-cast-name.d.mts +17 -0
- package/dist/plugins/ts-restrictions/rules/no-restricted-cast-name.d.mts.map +1 -0
- package/dist/plugins/ts-restrictions/rules/no-restricted-cast-name.mjs +171 -0
- package/dist/plugins/ts-restrictions/rules/no-restricted-cast-name.mjs.map +1 -0
- package/dist/plugins/{custom/rules/no-restricted-syntax2.d.mts → ts-restrictions/rules/no-restricted-syntax.d.mts} +1 -1
- package/dist/plugins/ts-restrictions/rules/no-restricted-syntax.d.mts.map +1 -0
- package/dist/plugins/{custom/rules/no-restricted-syntax2.mjs → ts-restrictions/rules/no-restricted-syntax.mjs} +1 -1
- package/dist/plugins/ts-restrictions/rules/no-restricted-syntax.mjs.map +1 -0
- package/dist/plugins/ts-restrictions/rules/rules.d.mts +14 -0
- package/dist/plugins/ts-restrictions/rules/rules.d.mts.map +1 -0
- package/dist/plugins/ts-restrictions/rules/rules.mjs +10 -0
- package/dist/plugins/ts-restrictions/rules/rules.mjs.map +1 -0
- package/dist/rules/eslint-ts-restrictions-rules.d.mts +5 -0
- package/dist/rules/eslint-ts-restrictions-rules.d.mts.map +1 -0
- package/dist/rules/eslint-ts-restrictions-rules.mjs +7 -0
- package/dist/rules/eslint-ts-restrictions-rules.mjs.map +1 -0
- package/dist/rules/index.d.mts +1 -0
- package/dist/rules/index.d.mts.map +1 -1
- package/dist/rules/index.mjs +1 -0
- package/dist/rules/index.mjs.map +1 -1
- package/dist/types/define-known-rules.d.mts +2 -2
- package/dist/types/define-known-rules.d.mts.map +1 -1
- package/dist/types/rules/eslint-ts-restrictions-rules.d.mts +150 -0
- package/dist/types/rules/eslint-ts-restrictions-rules.d.mts.map +1 -0
- package/dist/types/rules/eslint-ts-restrictions-rules.mjs +2 -0
- package/dist/types/rules/eslint-ts-restrictions-rules.mjs.map +1 -0
- package/dist/types/rules/index.d.mts +1 -1
- package/dist/types/rules/index.d.mts.map +1 -1
- package/package.json +1 -1
- package/src/configs/plugins.mts +3 -3
- package/src/configs/typescript.mts +2 -0
- package/src/entry-point.mts +1 -1
- package/src/plugins/index.mts +1 -1
- package/src/plugins/total-functions/rules/no-enums.test.mts +4 -3
- package/src/plugins/total-functions/rules/no-hidden-type-assertions.test.mts +32 -31
- package/src/plugins/total-functions/rules/no-nested-fp-ts-effects.test.mts +28 -27
- package/src/plugins/total-functions/rules/no-partial-array-reduce.test.mts +25 -24
- package/src/plugins/total-functions/rules/no-partial-division.test.mts +22 -21
- package/src/plugins/total-functions/rules/no-partial-string-normalize.test.mts +16 -15
- package/src/plugins/total-functions/rules/no-partial-url-constructor.test.mts +10 -9
- package/src/plugins/total-functions/rules/no-premature-fp-ts-effects.test.mts +14 -13
- package/src/plugins/total-functions/rules/no-unsafe-mutable-readonly-assignment.test.mts +483 -482
- package/src/plugins/total-functions/rules/no-unsafe-readonly-mutable-assignment.test.mts +334 -333
- package/src/plugins/total-functions/rules/no-unsafe-type-assertion.test.mts +7 -6
- package/src/plugins/tree-shakable/rules/import-star.test.mts +63 -62
- package/src/plugins/ts-restrictions/index.mts +1 -0
- package/src/plugins/ts-restrictions/plugin.mts +6 -0
- package/src/plugins/ts-restrictions/rules/no-restricted-cast-name.mts +234 -0
- package/src/plugins/ts-restrictions/rules/no-restricted-cast-name.test.mts +310 -0
- package/src/plugins/ts-restrictions/rules/rules.mts +8 -0
- package/src/rules/eslint-ts-restrictions-rules.mts +6 -0
- package/src/rules/index.mts +1 -0
- package/src/types/define-known-rules.mts +3 -3
- package/src/types/rules/eslint-ts-restrictions-rules.mts +174 -0
- package/src/types/rules/index.mts +1 -1
- package/dist/plugins/custom/custom.d.mts +0 -3
- package/dist/plugins/custom/custom.d.mts.map +0 -1
- package/dist/plugins/custom/custom.mjs +0 -8
- package/dist/plugins/custom/custom.mjs.map +0 -1
- package/dist/plugins/custom/index.d.mts +0 -2
- package/dist/plugins/custom/index.d.mts.map +0 -1
- package/dist/plugins/custom/index.mjs +0 -2
- package/dist/plugins/custom/rules/index.d.mts.map +0 -1
- package/dist/plugins/custom/rules/index.mjs +0 -2
- package/dist/plugins/custom/rules/no-restricted-syntax2.d.mts.map +0 -1
- package/dist/plugins/custom/rules/no-restricted-syntax2.mjs.map +0 -1
- package/dist/plugins/custom/rules/rules.d.mts +0 -4
- package/dist/plugins/custom/rules/rules.d.mts.map +0 -1
- package/dist/plugins/custom/rules/rules.mjs +0 -8
- package/dist/plugins/custom/rules/rules.mjs.map +0 -1
- package/dist/types/rules/eslint-custom-rules.d.mts +0 -62
- package/dist/types/rules/eslint-custom-rules.d.mts.map +0 -1
- package/dist/types/rules/eslint-custom-rules.mjs +0 -2
- package/dist/types/rules/eslint-custom-rules.mjs.map +0 -1
- package/src/plugins/custom/custom.mts +0 -6
- package/src/plugins/custom/index.mts +0 -1
- package/src/plugins/custom/rules/rules.mts +0 -6
- package/src/types/rules/eslint-custom-rules.mts +0 -76
- /package/dist/plugins/{custom → ts-restrictions}/index.mjs.map +0 -0
- /package/dist/plugins/{custom → ts-restrictions}/rules/index.d.mts +0 -0
- /package/dist/plugins/{custom → ts-restrictions}/rules/index.mjs.map +0 -0
- /package/src/plugins/{custom → ts-restrictions}/rules/index.mts +0 -0
- /package/src/plugins/{custom/rules/no-restricted-syntax2.mts → ts-restrictions/rules/no-restricted-syntax.mts} +0 -0
package/README.md
CHANGED
|
@@ -537,8 +537,8 @@ The shape of the rule option varies depending on the rule, so please check the c
|
|
|
537
537
|
- **`eslintPluginReactCodingStyle`**
|
|
538
538
|
- Custom ESLint plugin that codifies this repository's React memo component conventions (namespace imports, `React.memo<Props>`, arrow props naming, etc.). See [`src/plugins/react-coding-style/README.md`](src/plugins/react-coding-style/README.md) for the rationale and examples.
|
|
539
539
|
- Provides rules such as `react-coding-style/import-style`, `react-coding-style/component-var-type-annotation`, `react-coding-style/react-memo-type-parameter`, `react-coding-style/react-memo-props-argument-name`, `react-coding-style/props-type-annotation-style`, and `react-coding-style/react-hooks-definition-style`.
|
|
540
|
-
- **`
|
|
541
|
-
- Currently, this plugin only provides the `
|
|
540
|
+
- **`eslintPluginTsRestrictions`** - Custom ESLint plugin with additional rules for TypeScript
|
|
541
|
+
- Currently, this plugin only provides the `ts-restrictions/no-restricted-syntax` rule (which duplicates ESLint's `no-restricted-syntax` rule).
|
|
542
542
|
- Can be used to set the error level to `error` or `warn` as needed.
|
|
543
543
|
|
|
544
544
|
Example:
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { type ESLintPlugin } from '../types/index.mjs';
|
|
2
|
-
export declare const plugins: Record<'@typescript-eslint' | '@stylistic' | 'array-func' | 'cypress' | 'playwright' | 'functional' | 'import-x' | 'jest' | 'vitest' | 'jsx-a11y' | 'prefer-arrow-functions' | 'promise' | 'react' | 'react-hooks' | 'react-refresh' | 'react-perf' | 'security' | 'testing-library' | 'unicorn' | 'sort-destructure-keys' | 'eslint-plugin' | 'tree-shakable' | 'total-functions' | 'strict-dependencies' | '
|
|
2
|
+
export declare const plugins: Record<'@typescript-eslint' | '@stylistic' | 'array-func' | 'cypress' | 'playwright' | 'functional' | 'import-x' | 'jest' | 'vitest' | 'jsx-a11y' | 'prefer-arrow-functions' | 'promise' | 'react' | 'react-hooks' | 'react-refresh' | 'react-perf' | 'security' | 'testing-library' | 'unicorn' | 'sort-destructure-keys' | 'eslint-plugin' | 'tree-shakable' | 'total-functions' | 'strict-dependencies' | 'ts-restrictions' | 'react-coding-style' | 'vitest-coding-style', Omit<ESLintPlugin, 'configs'>>;
|
|
3
3
|
//# sourceMappingURL=plugins.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugins.d.mts","sourceRoot":"","sources":["../../src/configs/plugins.mts"],"names":[],"mappings":"AA6DA,OAAO,EAAE,KAAK,YAAY,EAAmB,MAAM,oBAAoB,CAAC;AAExE,eAAO,MAAM,OAAO,EAAE,MAAM,CACxB,oBAAoB,GACpB,YAAY,GACZ,YAAY,GACZ,SAAS,GACT,YAAY,GACZ,YAAY,GACZ,UAAU,GACV,MAAM,GACN,QAAQ,GACR,UAAU,GACV,wBAAwB,GACxB,SAAS,GACT,OAAO,GACP,aAAa,GACb,eAAe,GACf,YAAY,GACZ,UAAU,GACV,iBAAiB,GACjB,SAAS,GACT,uBAAuB,GACvB,eAAe,GACf,eAAe,GACf,iBAAiB,GACjB,qBAAqB,GACrB,
|
|
1
|
+
{"version":3,"file":"plugins.d.mts","sourceRoot":"","sources":["../../src/configs/plugins.mts"],"names":[],"mappings":"AA6DA,OAAO,EAAE,KAAK,YAAY,EAAmB,MAAM,oBAAoB,CAAC;AAExE,eAAO,MAAM,OAAO,EAAE,MAAM,CACxB,oBAAoB,GACpB,YAAY,GACZ,YAAY,GACZ,SAAS,GACT,YAAY,GACZ,YAAY,GACZ,UAAU,GACV,MAAM,GACN,QAAQ,GACR,UAAU,GACV,wBAAwB,GACxB,SAAS,GACT,OAAO,GACP,aAAa,GACb,eAAe,GACf,YAAY,GACZ,UAAU,GACV,iBAAiB,GACjB,SAAS,GACT,uBAAuB,GACvB,eAAe,GACf,eAAe,GACf,iBAAiB,GACjB,qBAAqB,GACrB,iBAAiB,GACjB,oBAAoB,GACpB,qBAAqB,EACvB,IAAI,CAAC,YAAY,EAAE,SAAS,CAAC,CAoCW,CAAC"}
|
package/dist/configs/plugins.mjs
CHANGED
|
@@ -19,11 +19,11 @@ import eslintPluginReactRefresh from 'eslint-plugin-react-refresh';
|
|
|
19
19
|
import eslintPluginReactPerf from 'eslint-plugin-react-perf';
|
|
20
20
|
import eslintPluginJsxA11y from 'eslint-plugin-jsx-a11y';
|
|
21
21
|
import eslintPluginEslintPlugin from 'eslint-plugin-eslint-plugin';
|
|
22
|
-
import { eslintPluginCustom } from '../plugins/custom/custom.mjs';
|
|
23
22
|
import { eslintPluginReactCodingStyle } from '../plugins/react-coding-style/plugin.mjs';
|
|
24
23
|
import { eslintPluginStrictDependencies } from '../plugins/strict-dependencies/plugin.mjs';
|
|
25
24
|
import { eslintPluginTotalFunctions } from '../plugins/total-functions/plugin.mjs';
|
|
26
25
|
import { eslintPluginTreeShakable } from '../plugins/tree-shakable/plugin.mjs';
|
|
26
|
+
import { eslintPluginTsRestrictions } from '../plugins/ts-restrictions/plugin.mjs';
|
|
27
27
|
import { eslintPluginVitestCodingStyle } from '../plugins/vitest-coding-style/plugin.mjs';
|
|
28
28
|
|
|
29
29
|
/* eslint-disable @stylistic/padding-line-between-statements */
|
|
@@ -60,7 +60,7 @@ const plugins = {
|
|
|
60
60
|
'tree-shakable': eslintPluginTreeShakable,
|
|
61
61
|
'total-functions': eslintPluginTotalFunctions,
|
|
62
62
|
'strict-dependencies': eslintPluginStrictDependencies,
|
|
63
|
-
|
|
63
|
+
'ts-restrictions': eslintPluginTsRestrictions,
|
|
64
64
|
'react-coding-style': eslintPluginReactCodingStyle,
|
|
65
65
|
'vitest-coding-style': eslintPluginVitestCodingStyle,
|
|
66
66
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugins.mjs","sources":["../../src/configs/plugins.mts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AA8DO,MAAM,OAAO,GA6BhB;AACF,IAAA,oBAAoB,EAAE,gBAAgB;AACtC,IAAA,YAAY,EAAE,SAAS;;AAEvB,IAAA,YAAY,EAAE,qBAAqB;AACnC,IAAA,OAAO,EAAE,mBAAmB;AAC5B,IAAA,UAAU,EAAE,sBAAsB;AAClC,IAAA,UAAU,EAAE,sBAAsB;;AAElC,IAAA,uBAAuB,EAAE,+BAA+B;AACxD,IAAA,UAAU,EAAE,kBAAkB;AAC9B,IAAA,IAAI,EAAE,gBAAgB;AACtB,IAAA,MAAM,EAAE,kBAAkB;;AAE1B,IAAA,UAAU,EAAE,mBAAmB;AAC/B,IAAA,wBAAwB,EAAE,gCAAgC;;AAE1D,IAAA,OAAO,EAAE,mBAAmB;AAC5B,IAAA,KAAK,EAAE,iBAAiB;;AAExB,IAAA,aAAa,EAAE,sBAAiD;AAChE,IAAA,eAAe,EAAE,wBAAwB;;AAEzC,IAAA,YAAY,EAAE,qBAAqB;;AAEnC,IAAA,QAAQ,EAAE,oBAAoB;AAC9B,IAAA,iBAAiB,EAAE,0BAA0B;AAC7C,IAAA,OAAO,EAAE,mBAAmB;AAC5B,IAAA,eAAe,EAAE,wBAAwB;AACzC,IAAA,eAAe,EAAE,wBAAwB;AACzC,IAAA,iBAAiB,EAAE,0BAA0B;AAC7C,IAAA,qBAAqB,EAAE,8BAA8B;AACrD,IAAA,
|
|
1
|
+
{"version":3,"file":"plugins.mjs","sources":["../../src/configs/plugins.mts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AA8DO,MAAM,OAAO,GA6BhB;AACF,IAAA,oBAAoB,EAAE,gBAAgB;AACtC,IAAA,YAAY,EAAE,SAAS;;AAEvB,IAAA,YAAY,EAAE,qBAAqB;AACnC,IAAA,OAAO,EAAE,mBAAmB;AAC5B,IAAA,UAAU,EAAE,sBAAsB;AAClC,IAAA,UAAU,EAAE,sBAAsB;;AAElC,IAAA,uBAAuB,EAAE,+BAA+B;AACxD,IAAA,UAAU,EAAE,kBAAkB;AAC9B,IAAA,IAAI,EAAE,gBAAgB;AACtB,IAAA,MAAM,EAAE,kBAAkB;;AAE1B,IAAA,UAAU,EAAE,mBAAmB;AAC/B,IAAA,wBAAwB,EAAE,gCAAgC;;AAE1D,IAAA,OAAO,EAAE,mBAAmB;AAC5B,IAAA,KAAK,EAAE,iBAAiB;;AAExB,IAAA,aAAa,EAAE,sBAAiD;AAChE,IAAA,eAAe,EAAE,wBAAwB;;AAEzC,IAAA,YAAY,EAAE,qBAAqB;;AAEnC,IAAA,QAAQ,EAAE,oBAAoB;AAC9B,IAAA,iBAAiB,EAAE,0BAA0B;AAC7C,IAAA,OAAO,EAAE,mBAAmB;AAC5B,IAAA,eAAe,EAAE,wBAAwB;AACzC,IAAA,eAAe,EAAE,wBAAwB;AACzC,IAAA,iBAAiB,EAAE,0BAA0B;AAC7C,IAAA,qBAAqB,EAAE,8BAA8B;AACrD,IAAA,iBAAiB,EAAE,0BAA0B;AAC7C,IAAA,oBAAoB,EAAE,4BAA4B;AAClD,IAAA,qBAAqB,EAAE,6BAA6B;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typescript.d.mts","sourceRoot":"","sources":["../../src/configs/typescript.mts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"typescript.d.mts","sourceRoot":"","sources":["../../src/configs/typescript.mts"],"names":[],"mappings":"AAgBA,OAAO,EAAoB,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAGvE,eAAO,MAAM,yBAAyB,GAAI,8EAMvC,QAAQ,CAAC;IACV,gBAAgB,EAAE,MAAM,CAAC;IACzB,eAAe,EAAE,MAAM,CAAC;IACxB,WAAW,EAAE,SAAS,MAAM,EAAE,CAAC;IAC/B,KAAK,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC1B,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B,CAAC,KAAG,SAAS,UAAU,EAkFZ,CAAC"}
|
|
@@ -10,6 +10,7 @@ import { eslintSecurityRules } from '../rules/eslint-security-rules.mjs';
|
|
|
10
10
|
import { eslintStylisticRules } from '../rules/eslint-stylistic-rules.mjs';
|
|
11
11
|
import { eslintTotalFunctionsRules } from '../rules/eslint-total-functions-rules.mjs';
|
|
12
12
|
import { eslintTreeShakableRules } from '../rules/eslint-tree-shakable-rules.mjs';
|
|
13
|
+
import { eslintCustomRules } from '../rules/eslint-ts-restrictions-rules.mjs';
|
|
13
14
|
import { eslintUnicornRules } from '../rules/eslint-unicorn-rules.mjs';
|
|
14
15
|
import { typescriptEslintRules } from '../rules/typescript-eslint-rules.mjs';
|
|
15
16
|
import { eslintConfigForTypeScriptWithoutRules } from './typescript-without-rules.mjs';
|
|
@@ -35,6 +36,7 @@ const eslintConfigForTypeScript = ({ files, packageDirs, tsconfigFileName, tscon
|
|
|
35
36
|
...typescriptEslintRules,
|
|
36
37
|
...eslintTreeShakableRules,
|
|
37
38
|
...eslintPluginSortDestructureKeysRules,
|
|
39
|
+
...eslintCustomRules,
|
|
38
40
|
'strict-dependencies/strict-dependencies': ['error', []],
|
|
39
41
|
'import-x/no-extraneous-dependencies': [
|
|
40
42
|
'error',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typescript.mjs","sources":["../../src/configs/typescript.mts"],"sourcesContent":[null],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"typescript.mjs","sources":["../../src/config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QAC9B,KAAK,EAAE,gBAAgB,CAAC;AACtB,YAAA,2CAA2C,EAAE,KAAK;AAClD,YAAA,sBAAsB,EAAE,KAAK;SAC9B,CAAC;AACH,KAAA;AACD,IAAA;AACE,QAAA,KAAK,EAAE;;;;;;;;YASL,qCAAqC;YAErC,uCAAuC;YAEvC,4CAA4C;YAC5C,gDAAgD;YAChD,qCAAqC;AACtC,SAAA;QACD,KAAK,EAAE,gBAAgB,CAAC;AACtB,YAAA,0CAA0C,EAAE,KAAK;AACjD,YAAA,4BAA4B,EAAE,KAAK;AACnC,YAAA,sCAAsC,EAAE,KAAK;AAC7C,YAAA,8BAA8B,EAAE,KAAK;AACrC,YAAA,8BAA8B,EAAE,KAAK;AACrC,YAAA,oBAAoB,EAAE,KAAK;SAC5B,CAAC;AACH,KAAA;;;;;"}
|
package/dist/entry-point.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { eslintConfigForTypeScriptWithoutRules, eslintConfigForTypeScript, eslintConfigForBrowser, eslintConfigForNodeJs, eslintConfigForReact, eslintConfigForPreact, eslintConfigForVitest, eslintConfigForJest, eslintConfigForPlaywright, eslintConfigForCypress, eslintConfigForTestingLibrary, eslintRules, typescriptEslintRules, eslintFunctionalRules, eslintTotalFunctionsRules, eslintUnicornRules, eslintArrayFuncRules, eslintPreferArrowFunctionRules, eslintPluginSortDestructureKeysRules, eslintImportsRules, eslintPromiseRules, eslintSecurityRules, eslintTreeShakableRules, eslintReactRules, eslintReactHooksRules, eslintReactPerfRules, eslintReactRefreshRules, eslintVitestRules, eslintJestRules, eslintJsxA11yRules, eslintTestingLibraryRules, eslintCypressRules, eslintPlaywrightRules, eslintPluginRules, restrictedGlobals, restrictedGlobalsForBrowser, restrictedSyntax,
|
|
1
|
+
export { eslintConfigForTypeScriptWithoutRules, eslintConfigForTypeScript, eslintConfigForBrowser, eslintConfigForNodeJs, eslintConfigForReact, eslintConfigForPreact, eslintConfigForVitest, eslintConfigForJest, eslintConfigForPlaywright, eslintConfigForCypress, eslintConfigForTestingLibrary, eslintRules, typescriptEslintRules, eslintFunctionalRules, eslintTotalFunctionsRules, eslintUnicornRules, eslintArrayFuncRules, eslintPreferArrowFunctionRules, eslintPluginSortDestructureKeysRules, eslintImportsRules, eslintPromiseRules, eslintSecurityRules, eslintTreeShakableRules, eslintReactRules, eslintReactHooksRules, eslintReactPerfRules, eslintReactRefreshRules, eslintVitestRules, eslintJestRules, eslintJsxA11yRules, eslintTestingLibraryRules, eslintCypressRules, eslintPlaywrightRules, eslintPluginRules, restrictedGlobals, restrictedGlobalsForBrowser, restrictedSyntax, eslintPluginTsRestrictions, eslintPluginReactCodingStyle, eslintPluginTotalFunctions, eslintPluginTreeShakable, defineConfig, defineKnownRules, withDefaultOption, plugins, type EslintRules, type EslintRulesOption, type TypeScriptEslintRules, type TypeScriptEslintRulesOption, type EslintFunctionalRules, type EslintFunctionalRulesOption, type EslintTotalFunctionsRules, type EslintUnicornRules, type EslintUnicornRulesOption, type EslintArrayFuncRules, type EslintPreferArrowFunctionRules, type EslintPreferArrowFunctionRulesOption, type EslintPluginSortDestructureKeysRules, type EslintPluginSortDestructureKeysRulesOption, type EslintPromiseRules, type EslintPromiseRulesOption, type EslintImportsRules, type EslintImportsRulesOption, type EslintStrictDependenciesRules, type EslintStrictDependenciesRulesOption, type EslintReactCodingStyleRules, type EslintSecurityRules, type EslintTreeShakableRules, type EslintReactRules, type EslintReactRulesOption, type EslintReactHooksRules, type EslintReactHooksRulesOption, type EslintReactPerfRules, type EslintReactPerfRulesOption, type EslintReactRefreshRules, type EslintReactRefreshRulesOption, type EslintJsxA11yRules, type EslintJsxA11yRulesOption, type EslintVitestRules, type EslintVitestRulesOption, type EslintJestRules, type EslintJestRulesOption, type EslintPlaywrightRules, type EslintPlaywrightRulesOption, type EslintCypressRules, type EslintCypressRulesOption, type EslintTestingLibraryRules, type EslintTestingLibraryRulesOption, type EslintPluginRules, type EslintPluginRulesOption, type FlatConfig, type ESLintPlugin, type Rule, type Rules, } from './index.mjs';
|
|
2
2
|
//# sourceMappingURL=entry-point.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entry-point.d.mts","sourceRoot":"","sources":["../src/entry-point.mts"],"names":[],"mappings":"AACA,OAAO,EAEL,qCAAqC,EACrC,yBAAyB,EACzB,sBAAsB,EACtB,qBAAqB,EACrB,oBAAoB,EACpB,qBAAqB,EACrB,qBAAqB,EACrB,mBAAmB,EACnB,yBAAyB,EACzB,sBAAsB,EACtB,6BAA6B,EAG7B,WAAW,EACX,qBAAqB,EACrB,qBAAqB,EACrB,yBAAyB,EACzB,kBAAkB,EAClB,oBAAoB,EACpB,8BAA8B,EAC9B,oCAAoC,EACpC,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,EACnB,uBAAuB,EACvB,gBAAgB,EAChB,qBAAqB,EACrB,oBAAoB,EACpB,uBAAuB,EACvB,iBAAiB,EACjB,eAAe,EACf,kBAAkB,EAClB,yBAAyB,EACzB,kBAAkB,EAClB,qBAAqB,EACrB,iBAAiB,EAGjB,iBAAiB,EACjB,2BAA2B,EAC3B,gBAAgB,EAGhB,
|
|
1
|
+
{"version":3,"file":"entry-point.d.mts","sourceRoot":"","sources":["../src/entry-point.mts"],"names":[],"mappings":"AACA,OAAO,EAEL,qCAAqC,EACrC,yBAAyB,EACzB,sBAAsB,EACtB,qBAAqB,EACrB,oBAAoB,EACpB,qBAAqB,EACrB,qBAAqB,EACrB,mBAAmB,EACnB,yBAAyB,EACzB,sBAAsB,EACtB,6BAA6B,EAG7B,WAAW,EACX,qBAAqB,EACrB,qBAAqB,EACrB,yBAAyB,EACzB,kBAAkB,EAClB,oBAAoB,EACpB,8BAA8B,EAC9B,oCAAoC,EACpC,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,EACnB,uBAAuB,EACvB,gBAAgB,EAChB,qBAAqB,EACrB,oBAAoB,EACpB,uBAAuB,EACvB,iBAAiB,EACjB,eAAe,EACf,kBAAkB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ACX,MAAM,aAAa,CAAC"}
|
package/dist/entry-point.mjs
CHANGED
|
@@ -37,7 +37,6 @@ export { eslintConfigForTestingLibrary } from './configs/testing-library.mjs';
|
|
|
37
37
|
export { eslintConfigForTypeScriptWithoutRules } from './configs/typescript-without-rules.mjs';
|
|
38
38
|
export { eslintConfigForTypeScript } from './configs/typescript.mjs';
|
|
39
39
|
export { eslintConfigForVitest } from './configs/vitest.mjs';
|
|
40
|
-
export { eslintPluginCustom } from './plugins/custom/custom.mjs';
|
|
41
40
|
export { eslintPluginReactCodingStyle } from './plugins/react-coding-style/plugin.mjs';
|
|
42
41
|
import 'is-glob';
|
|
43
42
|
import 'micromatch';
|
|
@@ -46,5 +45,6 @@ import 'ts-data-forge';
|
|
|
46
45
|
import 'typescript';
|
|
47
46
|
export { eslintPluginTotalFunctions } from './plugins/total-functions/plugin.mjs';
|
|
48
47
|
export { eslintPluginTreeShakable } from './plugins/tree-shakable/plugin.mjs';
|
|
48
|
+
export { eslintPluginTsRestrictions } from './plugins/ts-restrictions/plugin.mjs';
|
|
49
49
|
import '@typescript-eslint/utils';
|
|
50
50
|
//# sourceMappingURL=entry-point.mjs.map
|
package/dist/index.mjs
CHANGED
|
@@ -11,11 +11,11 @@ export { eslintConfigForTestingLibrary } from './configs/testing-library.mjs';
|
|
|
11
11
|
export { eslintConfigForTypeScriptWithoutRules } from './configs/typescript-without-rules.mjs';
|
|
12
12
|
export { eslintConfigForTypeScript } from './configs/typescript.mjs';
|
|
13
13
|
export { eslintConfigForVitest } from './configs/vitest.mjs';
|
|
14
|
-
export { eslintPluginCustom } from './plugins/custom/custom.mjs';
|
|
15
14
|
export { eslintPluginReactCodingStyle } from './plugins/react-coding-style/plugin.mjs';
|
|
16
15
|
export { eslintPluginStrictDependencies } from './plugins/strict-dependencies/plugin.mjs';
|
|
17
16
|
export { eslintPluginTotalFunctions } from './plugins/total-functions/plugin.mjs';
|
|
18
17
|
export { eslintPluginTreeShakable } from './plugins/tree-shakable/plugin.mjs';
|
|
18
|
+
export { eslintPluginTsRestrictions } from './plugins/ts-restrictions/plugin.mjs';
|
|
19
19
|
export { eslintPluginVitestCodingStyle } from './plugins/vitest-coding-style/plugin.mjs';
|
|
20
20
|
export { allExtensionsRegexUnionStr, allExtensionsStr } from './rules/all-extensions.mjs';
|
|
21
21
|
export { eslintArrayFuncRules } from './rules/eslint-array-func-rules.mjs';
|
|
@@ -40,6 +40,7 @@ export { eslintStylisticRules } from './rules/eslint-stylistic-rules.mjs';
|
|
|
40
40
|
export { eslintTestingLibraryRules } from './rules/eslint-testing-library-rules.mjs';
|
|
41
41
|
export { eslintTotalFunctionsRules } from './rules/eslint-total-functions-rules.mjs';
|
|
42
42
|
export { eslintTreeShakableRules } from './rules/eslint-tree-shakable-rules.mjs';
|
|
43
|
+
export { eslintCustomRules } from './rules/eslint-ts-restrictions-rules.mjs';
|
|
43
44
|
export { eslintUnicornRules } from './rules/eslint-unicorn-rules.mjs';
|
|
44
45
|
export { eslintVitestCodingStyleRules } from './rules/eslint-vitest-coding-style-rules.mjs';
|
|
45
46
|
export { eslintVitestRules } from './rules/eslint-vitest-rules.mjs';
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/plugins/index.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export * from './custom/index.mjs';
|
|
2
1
|
export * from './react-coding-style/index.mjs';
|
|
3
2
|
export * from './strict-dependencies/index.mjs';
|
|
4
3
|
export * from './total-functions/index.mjs';
|
|
5
4
|
export * from './tree-shakable/index.mjs';
|
|
5
|
+
export * from './ts-restrictions/index.mjs';
|
|
6
6
|
export * from './vitest-coding-style/index.mjs';
|
|
7
7
|
//# sourceMappingURL=index.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/plugins/index.mts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/plugins/index.mts"],"names":[],"mappings":"AAAA,cAAc,gCAAgC,CAAC;AAC/C,cAAc,iCAAiC,CAAC;AAChD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,iCAAiC,CAAC"}
|
package/dist/plugins/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { eslintPluginCustom } from './custom/custom.mjs';
|
|
2
1
|
export { eslintPluginReactCodingStyle } from './react-coding-style/plugin.mjs';
|
|
3
2
|
export { eslintPluginStrictDependencies } from './strict-dependencies/plugin.mjs';
|
|
4
3
|
export { eslintPluginTotalFunctions } from './total-functions/plugin.mjs';
|
|
5
4
|
export { eslintPluginTreeShakable } from './tree-shakable/plugin.mjs';
|
|
5
|
+
export { eslintPluginTsRestrictions } from './ts-restrictions/plugin.mjs';
|
|
6
6
|
export { eslintPluginVitestCodingStyle } from './vitest-coding-style/plugin.mjs';
|
|
7
7
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/plugins/ts-restrictions/index.mts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.d.mts","sourceRoot":"","sources":["../../../src/plugins/ts-restrictions/plugin.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAG1D,eAAO,MAAM,0BAA0B,EAAE,YAE/B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.mjs","sources":["../../../src/plugins/ts-restrictions/plugin.mts"],"sourcesContent":[null],"names":[],"mappings":";;AAGO,MAAM,0BAA0B,GAAiB;AACtD,IAAA,KAAK,EAAE,mBAAmB;;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../../src/plugins/ts-restrictions/rules/index.mts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type TSESLint } from '@typescript-eslint/utils';
|
|
2
|
+
type FixWithOption = Readonly<{
|
|
3
|
+
kind: 'type';
|
|
4
|
+
name: string;
|
|
5
|
+
}> | Readonly<{
|
|
6
|
+
kind: 'function';
|
|
7
|
+
name: string;
|
|
8
|
+
}>;
|
|
9
|
+
type RestrictedCastOption = string | Readonly<{
|
|
10
|
+
name: string;
|
|
11
|
+
fixWith?: FixWithOption;
|
|
12
|
+
}>;
|
|
13
|
+
type Options = readonly RestrictedCastOption[];
|
|
14
|
+
type MessageIds = 'restrictedCast';
|
|
15
|
+
export declare const noRestrictedCastName: TSESLint.RuleModule<MessageIds, Options>;
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=no-restricted-cast-name.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"no-restricted-cast-name.d.mts","sourceRoot":"","sources":["../../../../src/plugins/ts-restrictions/rules/no-restricted-cast-name.mts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,QAAQ,EAEd,MAAM,0BAA0B,CAAC;AAElC,KAAK,aAAa,GACd,QAAQ,CAAC;IACP,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd,CAAC,GACF,QAAQ,CAAC;IACP,IAAI,EAAE,UAAU,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;CACd,CAAC,CAAC;AAEP,KAAK,oBAAoB,GACrB,MAAM,GACN,QAAQ,CAAC;IACP,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,aAAa,CAAC;CACzB,CAAC,CAAC;AAEP,KAAK,OAAO,GAAG,SAAS,oBAAoB,EAAE,CAAC;AAE/C,KAAK,UAAU,GAAG,gBAAgB,CAAC;AAmDnC,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAC,UAAU,CAAC,UAAU,EAAE,OAAO,CA6JzE,CAAC"}
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import { AST_NODE_TYPES } from '@typescript-eslint/utils';
|
|
2
|
+
|
|
3
|
+
const getTypeName = (typeAnnotation) => {
|
|
4
|
+
if (typeAnnotation === undefined)
|
|
5
|
+
return undefined;
|
|
6
|
+
if (typeAnnotation.type === AST_NODE_TYPES.TSTypeReference) {
|
|
7
|
+
const { typeName } = typeAnnotation;
|
|
8
|
+
if (typeName.type === AST_NODE_TYPES.Identifier) {
|
|
9
|
+
return typeName.name;
|
|
10
|
+
}
|
|
11
|
+
if (typeName.type === AST_NODE_TYPES.TSQualifiedName) {
|
|
12
|
+
const parts = [];
|
|
13
|
+
// eslint-disable-next-line functional/no-let
|
|
14
|
+
let current = typeName;
|
|
15
|
+
while (current.type === AST_NODE_TYPES.TSQualifiedName) {
|
|
16
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
17
|
+
if (current.right.type === AST_NODE_TYPES.Identifier) {
|
|
18
|
+
// eslint-disable-next-line functional/immutable-data
|
|
19
|
+
parts.unshift(current.right.name);
|
|
20
|
+
}
|
|
21
|
+
if (current.left.type !== AST_NODE_TYPES.Identifier &&
|
|
22
|
+
current.left.type !== AST_NODE_TYPES.TSQualifiedName) {
|
|
23
|
+
break;
|
|
24
|
+
}
|
|
25
|
+
current = current.left;
|
|
26
|
+
}
|
|
27
|
+
if (current.type === AST_NODE_TYPES.Identifier) {
|
|
28
|
+
// eslint-disable-next-line functional/immutable-data
|
|
29
|
+
parts.unshift(current.name);
|
|
30
|
+
}
|
|
31
|
+
return parts.join('.');
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
return undefined;
|
|
35
|
+
};
|
|
36
|
+
const noRestrictedCastName = {
|
|
37
|
+
meta: {
|
|
38
|
+
type: 'problem',
|
|
39
|
+
docs: {
|
|
40
|
+
description: 'Disallow type assertions with specified type names',
|
|
41
|
+
},
|
|
42
|
+
fixable: 'code',
|
|
43
|
+
schema: {
|
|
44
|
+
type: 'array',
|
|
45
|
+
items: {
|
|
46
|
+
oneOf: [
|
|
47
|
+
{
|
|
48
|
+
type: 'string',
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
type: 'object',
|
|
52
|
+
properties: {
|
|
53
|
+
name: { type: 'string' },
|
|
54
|
+
fixWith: {
|
|
55
|
+
type: 'object',
|
|
56
|
+
oneOf: [
|
|
57
|
+
{
|
|
58
|
+
type: 'object',
|
|
59
|
+
properties: {
|
|
60
|
+
kind: { type: 'string', enum: ['type'] },
|
|
61
|
+
name: { type: 'string' },
|
|
62
|
+
},
|
|
63
|
+
required: ['kind', 'name'],
|
|
64
|
+
additionalProperties: false,
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
type: 'object',
|
|
68
|
+
properties: {
|
|
69
|
+
kind: { type: 'string', enum: ['function'] },
|
|
70
|
+
name: { type: 'string' },
|
|
71
|
+
},
|
|
72
|
+
required: ['kind', 'name'],
|
|
73
|
+
additionalProperties: false,
|
|
74
|
+
},
|
|
75
|
+
],
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
required: ['name'],
|
|
79
|
+
additionalProperties: false,
|
|
80
|
+
},
|
|
81
|
+
],
|
|
82
|
+
},
|
|
83
|
+
uniqueItems: true,
|
|
84
|
+
minItems: 0,
|
|
85
|
+
},
|
|
86
|
+
messages: {
|
|
87
|
+
restrictedCast: 'Type assertion with "{{typeName}}" is not allowed{{fixMessage}}',
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
create: (context) => {
|
|
91
|
+
const options = context.options;
|
|
92
|
+
const restrictedTypes = new Map();
|
|
93
|
+
for (const option of options) {
|
|
94
|
+
if (typeof option === 'string') {
|
|
95
|
+
// eslint-disable-next-line functional/immutable-data
|
|
96
|
+
restrictedTypes.set(option, undefined);
|
|
97
|
+
}
|
|
98
|
+
else {
|
|
99
|
+
// eslint-disable-next-line functional/immutable-data
|
|
100
|
+
restrictedTypes.set(option.name, option.fixWith);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
const createFix = (node, fixWith) => {
|
|
104
|
+
const sourceCode = context.sourceCode;
|
|
105
|
+
const expressionText = sourceCode.getText(
|
|
106
|
+
// eslint-disable-next-line total-functions/no-unsafe-type-assertion
|
|
107
|
+
node.expression);
|
|
108
|
+
if (fixWith.kind === 'type') {
|
|
109
|
+
return (fixer) => fixer.replaceText(
|
|
110
|
+
// eslint-disable-next-line total-functions/no-unsafe-type-assertion
|
|
111
|
+
node, `${expressionText} as ${fixWith.name}`);
|
|
112
|
+
}
|
|
113
|
+
else {
|
|
114
|
+
// kind === 'function'
|
|
115
|
+
return (fixer) => fixer.replaceText(
|
|
116
|
+
// eslint-disable-next-line total-functions/no-unsafe-type-assertion
|
|
117
|
+
node, `${fixWith.name}(${expressionText})`);
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
return {
|
|
121
|
+
TSAsExpression: (node) => {
|
|
122
|
+
// eslint-disable-next-line total-functions/no-unsafe-type-assertion
|
|
123
|
+
const typeName = getTypeName(node.typeAnnotation);
|
|
124
|
+
if (typeName === undefined)
|
|
125
|
+
return;
|
|
126
|
+
const fixWith = restrictedTypes.get(typeName);
|
|
127
|
+
if (fixWith === undefined && !restrictedTypes.has(typeName))
|
|
128
|
+
return;
|
|
129
|
+
context.report({
|
|
130
|
+
node: node.typeAnnotation,
|
|
131
|
+
messageId: 'restrictedCast',
|
|
132
|
+
data: {
|
|
133
|
+
typeName,
|
|
134
|
+
fixMessage: fixWith !== undefined
|
|
135
|
+
? fixWith.kind === 'type'
|
|
136
|
+
? `. Use "${fixWith.name}" instead`
|
|
137
|
+
: `. Use "${fixWith.name}()" instead`
|
|
138
|
+
: '',
|
|
139
|
+
},
|
|
140
|
+
fix: fixWith !== undefined ? createFix(node, fixWith) : undefined,
|
|
141
|
+
});
|
|
142
|
+
},
|
|
143
|
+
TSTypeAssertion: (node) => {
|
|
144
|
+
// eslint-disable-next-line total-functions/no-unsafe-type-assertion
|
|
145
|
+
const typeName = getTypeName(node.typeAnnotation);
|
|
146
|
+
if (typeName === undefined)
|
|
147
|
+
return;
|
|
148
|
+
const fixWith = restrictedTypes.get(typeName);
|
|
149
|
+
if (fixWith === undefined && !restrictedTypes.has(typeName))
|
|
150
|
+
return;
|
|
151
|
+
context.report({
|
|
152
|
+
node: node.typeAnnotation,
|
|
153
|
+
messageId: 'restrictedCast',
|
|
154
|
+
data: {
|
|
155
|
+
typeName,
|
|
156
|
+
fixMessage: fixWith !== undefined
|
|
157
|
+
? fixWith.kind === 'type'
|
|
158
|
+
? `. Use "${fixWith.name}" instead`
|
|
159
|
+
: `. Use "${fixWith.name}()" instead`
|
|
160
|
+
: '',
|
|
161
|
+
},
|
|
162
|
+
fix: fixWith !== undefined ? createFix(node, fixWith) : undefined,
|
|
163
|
+
});
|
|
164
|
+
},
|
|
165
|
+
};
|
|
166
|
+
},
|
|
167
|
+
defaultOptions: [],
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
export { noRestrictedCastName };
|
|
171
|
+
//# sourceMappingURL=no-restricted-cast-name.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"no-restricted-cast-name.mjs","sources":["../../../../src/plugins/ts-restrictions/rules/no-restricted-cast-name.mts"],"sourcesContent":[null],"names":[],"mappings":";;AA2BA,MAAM,WAAW,GAAG,CAClB,cAA2D,KACrC;IACtB,IAAI,cAAc,KAAK,SAAS;AAAE,QAAA,OAAO,SAAS;IAElD,IAAI,cAAc,CAAC,IAAI,KAAK,cA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,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,SAAS;AAClE,iBAAA,CAAC;YACJ,CAAC;SACF;IACH,CAAC;AACD,IAAA,cAAc,EAAE,EAAE;;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"no-restricted-syntax.d.mts","sourceRoot":"","sources":["../../../../src/plugins/ts-restrictions/rules/no-restricted-syntax.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,QAAQ,CAAC;AAGnC,eAAO,MAAM,kBAAkB,EAAE,IAAI,CAAC,UAwE5B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"no-restricted-syntax.mjs","sources":["../../../../src/plugins/ts-restrictions/rules/no-restricted-syntax.mts"],"sourcesContent":[null],"names":[],"mappings":"AAGO,MAAM,kBAAkB,GAAoB;AACjD,IAAA,IAAI,EAAE;AACJ,QAAA,IAAI,EAAE,YAAY;AAElB,QAAA,IAAI,EAAE;AACJ,YAAA,WAAW,EAAE,2BAA2B;AACxC,YAAA,WAAW,EAAE,KAAK;AAClB,YAAA,GAAG,EAAE,2DAA2D;AACjE,SAAA;AAED,QAAA,MAAM,EAAE;AACN,YAAA,IAAI,EAAE,OAAO;AACb,YAAA,KAAK,EAAE;AACL,gBAAA,KAAK,EAAE;AACL,oBAAA;AACE,wBAAA,IAAI,EAAE,QAAQ;AACf,qBAAA;AACD,oBAAA;AACE,wBAAA,IAAI,EAAE,QAAQ;AACd,wBAAA,UAAU,EAAE;AACV,4BAAA,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;AAC5B,4BAAA,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;AAC5B,yBAAA;wBACD,QAAQ,EAAE,CAAC,UAAU,CAAC;AACtB,wBAAA,oBAAoB,EAAE,KAAK;AAC5B,qBAAA;AACF,iBAAA;AACF,aAAA;AACD,YAAA,WAAW,EAAE,IAAI;AACjB,YAAA,QAAQ,EAAE,CAAC;AACZ,SAAA;AAED,QAAA,QAAQ,EAAE;AACR,YAAA,gBAAgB,EAAE,aAAa;AAChC,SAAA;AACF,KAAA;AAED,IAAA,MAAM,EAAE,CAAC,OAAuC,KAC9C,OAAO,CAAC,OAAO,CAAC,MAAM,CACpB,CAAC,MAAqB,EAAE,gBAAyB,KAAI;;QAEnD,MAAM,sBAAsB,GAAG,gBAEqB;AAEpD,QAAA,MAAM,cAAc,GAAG,OAAO,sBAAsB,KAAK,QAAQ;QAEjE,MAAM,gBAAgB,GACpB,CAAC,cAAc,IAAI,gBAAgB,CAAC,sBAAsB,CAAC,OAAO,CAAC;QAErE,MAAM,QAAQ,GAAG;AACf,cAAE;AACF,cAAE,sBAAsB,CAAC,QAAQ;QAEnC,MAAM,OAAO,GAAG;cACZ,sBAAsB,CAAC;AACzB,cAAE,CAAA,OAAA,EAAU,QAAQ,CAAA,iBAAA,CAAmB;;AAGzC,QAAA,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE;;AAE3B,YAAA,CAAC,QAAQ,GAAG,CAAC,IAAiB,KAAI;gBAChC,OAAO,CAAC,MAAM,CAAC;oBACb,IAAI;AACJ,oBAAA,SAAS,EAAE,kBAAkB;oBAC7B,IAAI,EAAE,EAAE,OAAO,EAAE;AAClB,iBAAA,CAAC;YACJ,CAAC;AACF,SAAA,CAAC;IACJ,CAAC,EACD,EAAE,CACH;;AAGL,MAAM,gBAAgB,GAAG,CAAC,CAAU,KAClC,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,EAAE;;;;"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare const tsRestrictionsRules: {
|
|
2
|
+
readonly 'no-restricted-cast-name': import("@typescript-eslint/utils/ts-eslint").RuleModule<"restrictedCast", readonly (string | Readonly<{
|
|
3
|
+
name: string;
|
|
4
|
+
fixWith?: Readonly<{
|
|
5
|
+
kind: "type";
|
|
6
|
+
name: string;
|
|
7
|
+
}> | Readonly<{
|
|
8
|
+
kind: "function";
|
|
9
|
+
name: string;
|
|
10
|
+
}>;
|
|
11
|
+
}>)[], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
12
|
+
readonly 'no-restricted-syntax': import("eslint").Rule.RuleModule;
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=rules.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rules.d.mts","sourceRoot":"","sources":["../../../../src/plugins/ts-restrictions/rules/rules.mts"],"names":[],"mappings":"AAIA,eAAO,MAAM,mBAAmB;;;;;;;;;;;;CAGU,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { noRestrictedCastName } from './no-restricted-cast-name.mjs';
|
|
2
|
+
import { noRestrictedSyntax } from './no-restricted-syntax.mjs';
|
|
3
|
+
|
|
4
|
+
const tsRestrictionsRules = {
|
|
5
|
+
'no-restricted-cast-name': noRestrictedCastName,
|
|
6
|
+
'no-restricted-syntax': noRestrictedSyntax,
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export { tsRestrictionsRules };
|
|
10
|
+
//# sourceMappingURL=rules.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rules.mjs","sources":["../../../../src/plugins/ts-restrictions/rules/rules.mts"],"sourcesContent":[null],"names":[],"mappings":";;;AAIO,MAAM,mBAAmB,GAAG;AACjC,IAAA,yBAAyB,EAAE,oBAAoB;AAC/C,IAAA,sBAAsB,EAAE,kBAAkB;;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eslint-ts-restrictions-rules.d.mts","sourceRoot":"","sources":["../../src/rules/eslint-ts-restrictions-rules.mts"],"names":[],"mappings":"AAEA,eAAO,MAAM,iBAAiB;;;CAGgB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eslint-ts-restrictions-rules.mjs","sources":["../../src/rules/eslint-ts-restrictions-rules.mts"],"sourcesContent":[null],"names":[],"mappings":"AAEO,MAAM,iBAAiB,GAAG;AAC/B,IAAA,sCAAsC,EAAE,KAAK;AAC7C,IAAA,yCAAyC,EAAE,KAAK;;;;;"}
|
package/dist/rules/index.d.mts
CHANGED
|
@@ -21,6 +21,7 @@ export * from './eslint-stylistic-rules.mjs';
|
|
|
21
21
|
export * from './eslint-testing-library-rules.mjs';
|
|
22
22
|
export * from './eslint-total-functions-rules.mjs';
|
|
23
23
|
export * from './eslint-tree-shakable-rules.mjs';
|
|
24
|
+
export * from './eslint-ts-restrictions-rules.mjs';
|
|
24
25
|
export * from './eslint-unicorn-rules.mjs';
|
|
25
26
|
export * from './eslint-vitest-coding-style-rules.mjs';
|
|
26
27
|
export * from './eslint-vitest-rules.mjs';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/rules/index.mts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yBAAyB,CAAC;AACxC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iDAAiD,CAAC;AAChE,cAAc,2CAA2C,CAAC;AAC1D,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uCAAuC,CAAC;AACtD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,kCAAkC,CAAC;AACjD,cAAc,0BAA0B,CAAC;AACzC,cAAc,oBAAoB,CAAC;AACnC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,oCAAoC,CAAC;AACnD,cAAc,oCAAoC,CAAC;AACnD,cAAc,kCAAkC,CAAC;AACjD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,wCAAwC,CAAC;AACvD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,+BAA+B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/rules/index.mts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yBAAyB,CAAC;AACxC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iDAAiD,CAAC;AAChE,cAAc,2CAA2C,CAAC;AAC1D,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uCAAuC,CAAC;AACtD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,kCAAkC,CAAC;AACjD,cAAc,0BAA0B,CAAC;AACzC,cAAc,oBAAoB,CAAC;AACnC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,oCAAoC,CAAC;AACnD,cAAc,oCAAoC,CAAC;AACnD,cAAc,kCAAkC,CAAC;AACjD,cAAc,oCAAoC,CAAC;AACnD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,wCAAwC,CAAC;AACvD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,+BAA+B,CAAC"}
|
package/dist/rules/index.mjs
CHANGED
|
@@ -21,6 +21,7 @@ export { eslintStylisticRules } from './eslint-stylistic-rules.mjs';
|
|
|
21
21
|
export { eslintTestingLibraryRules } from './eslint-testing-library-rules.mjs';
|
|
22
22
|
export { eslintTotalFunctionsRules } from './eslint-total-functions-rules.mjs';
|
|
23
23
|
export { eslintTreeShakableRules } from './eslint-tree-shakable-rules.mjs';
|
|
24
|
+
export { eslintCustomRules } from './eslint-ts-restrictions-rules.mjs';
|
|
24
25
|
export { eslintUnicornRules } from './eslint-unicorn-rules.mjs';
|
|
25
26
|
export { eslintVitestCodingStyleRules } from './eslint-vitest-coding-style-rules.mjs';
|
|
26
27
|
export { eslintVitestRules } from './eslint-vitest-rules.mjs';
|
package/dist/rules/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type EslintArrayFuncRules, type
|
|
2
|
-
type KnownRules = DeepReadonly<
|
|
1
|
+
import { type EslintArrayFuncRules, type EslintCypressRules, type EslintFunctionalRules, type EslintImportsRules, type EslintJestRules, type EslintJsxA11yRules, type EslintPlaywrightRules, type EslintPluginRules, type EslintPluginSortDestructureKeysRules, type EslintPreferArrowFunctionRules, type EslintPromiseRules, type EslintReactCodingStyleRules, type EslintReactHooksRules, type EslintReactPerfRules, type EslintReactRefreshRules, type EslintReactRules, type EslintRules, type EslintSecurityRules, type EslintStrictDependenciesRules, type EslintStylisticRules, type EslintTestingLibraryRules, type EslintTotalFunctionsRules, type EslintTreeShakableRules, type EslintTsRestrictionsRules, type EslintUnicornRules, type EslintVitestRules, type TypeScriptEslintRules } from './rules/index.mjs';
|
|
2
|
+
type KnownRules = DeepReadonly<EslintTsRestrictionsRules & EslintArrayFuncRules & EslintCypressRules & EslintFunctionalRules & EslintImportsRules & EslintJestRules & EslintJsxA11yRules & EslintPlaywrightRules & EslintPluginRules & EslintPluginSortDestructureKeysRules & EslintPreferArrowFunctionRules & EslintPromiseRules & EslintReactHooksRules & EslintReactPerfRules & EslintReactRefreshRules & EslintReactRules & EslintRules & EslintStylisticRules & EslintSecurityRules & EslintStrictDependenciesRules & EslintTestingLibraryRules & EslintTotalFunctionsRules & EslintTreeShakableRules & EslintUnicornRules & EslintVitestRules & EslintReactCodingStyleRules & TypeScriptEslintRules>;
|
|
3
3
|
export declare const defineKnownRules: (rules: Partial<KnownRules>) => Partial<KnownRules>;
|
|
4
4
|
export {};
|
|
5
5
|
//# sourceMappingURL=define-known-rules.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"define-known-rules.d.mts","sourceRoot":"","sources":["../../src/types/define-known-rules.mts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,oBAAoB,EACzB,KAAK,
|
|
1
|
+
{"version":3,"file":"define-known-rules.d.mts","sourceRoot":"","sources":["../../src/types/define-known-rules.mts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,EACvB,KAAK,qBAAqB,EAC1B,KAAK,kBAAkB,EACvB,KAAK,eAAe,EACpB,KAAK,kBAAkB,EACvB,KAAK,qBAAqB,EAC1B,KAAK,iBAAiB,EACtB,KAAK,oCAAoC,EACzC,KAAK,8BAA8B,EACnC,KAAK,kBAAkB,EACvB,KAAK,2BAA2B,EAChC,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EACzB,KAAK,uBAAuB,EAC5B,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAChB,KAAK,mBAAmB,EACxB,KAAK,6BAA6B,EAClC,KAAK,oBAAoB,EACzB,KAAK,yBAAyB,EAC9B,KAAK,yBAAyB,EAC9B,KAAK,uBAAuB,EAC5B,KAAK,yBAAyB,EAC9B,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,qBAAqB,EAC3B,MAAM,mBAAmB,CAAC;AAE3B,KAAK,UAAU,GAAG,YAAY,CAC5B,yBAAyB,GACvB,oBAAoB,GACpB,kBAAkB,GAClB,qBAAqB,GACrB,kBAAkB,GAClB,eAAe,GACf,kBAAkB,GAClB,qBAAqB,GACrB,iBAAiB,GACjB,oCAAoC,GACpC,8BAA8B,GAC9B,kBAAkB,GAClB,qBAAqB,GACrB,oBAAoB,GACpB,uBAAuB,GACvB,gBAAgB,GAChB,WAAW,GACX,oBAAoB,GACpB,mBAAmB,GACnB,6BAA6B,GAC7B,yBAAyB,GACzB,yBAAyB,GACzB,uBAAuB,GACvB,kBAAkB,GAClB,iBAAiB,GACjB,2BAA2B,GAC3B,qBAAqB,CACxB,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAC3B,OAAO,OAAO,CAAC,UAAU,CAAC,KACzB,OAAO,CAAC,UAAU,CAAU,CAAC"}
|