eslint-config-typed 2.2.1 → 2.3.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/dist/configs/plugins.d.mts.map +1 -1
- package/dist/configs/plugins.mjs +1 -2
- package/dist/configs/plugins.mjs.map +1 -1
- package/dist/configs/typescript.d.mts.map +1 -1
- package/dist/configs/typescript.mjs +2 -1
- package/dist/configs/typescript.mjs.map +1 -1
- package/dist/entry-point.mjs +5 -0
- package/dist/entry-point.mjs.map +1 -1
- package/dist/index.mjs +1 -0
- package/dist/index.mjs.map +1 -1
- package/dist/plugins/index.d.mts +1 -0
- package/dist/plugins/index.d.mts.map +1 -1
- package/dist/plugins/index.mjs +1 -0
- package/dist/plugins/index.mjs.map +1 -1
- package/dist/plugins/strict-dependencies/index.d.mts +2 -0
- package/dist/plugins/strict-dependencies/index.d.mts.map +1 -0
- package/dist/plugins/strict-dependencies/index.mjs +2 -0
- package/dist/plugins/strict-dependencies/index.mjs.map +1 -0
- package/dist/plugins/strict-dependencies/plugin.d.mts +3 -0
- package/dist/plugins/strict-dependencies/plugin.d.mts.map +1 -0
- package/dist/plugins/strict-dependencies/plugin.mjs +9 -0
- package/dist/plugins/strict-dependencies/plugin.mjs.map +1 -0
- package/dist/plugins/strict-dependencies/rules/index.d.mts +2 -0
- package/dist/plugins/strict-dependencies/rules/index.d.mts.map +1 -0
- package/dist/plugins/strict-dependencies/rules/index.mjs +2 -0
- package/dist/plugins/strict-dependencies/rules/index.mjs.map +1 -0
- package/dist/plugins/strict-dependencies/rules/resolve-import-path.d.mts +5 -0
- package/dist/plugins/strict-dependencies/rules/resolve-import-path.d.mts.map +1 -0
- package/dist/plugins/strict-dependencies/rules/resolve-import-path.mjs +79 -0
- package/dist/plugins/strict-dependencies/rules/resolve-import-path.mjs.map +1 -0
- package/dist/plugins/strict-dependencies/rules/rules.d.mts +19 -0
- package/dist/plugins/strict-dependencies/rules/rules.d.mts.map +1 -0
- package/dist/plugins/strict-dependencies/rules/rules.mjs +8 -0
- package/dist/plugins/strict-dependencies/rules/rules.mjs.map +1 -0
- package/dist/plugins/strict-dependencies/rules/strict-dependencies.d.mts +17 -0
- package/dist/plugins/strict-dependencies/rules/strict-dependencies.d.mts.map +1 -0
- package/dist/plugins/strict-dependencies/rules/strict-dependencies.mjs +139 -0
- package/dist/plugins/strict-dependencies/rules/strict-dependencies.mjs.map +1 -0
- package/dist/plugins/total-functions/plugin.mjs +0 -18
- package/dist/plugins/total-functions/plugin.mjs.map +1 -1
- package/dist/plugins/total-functions/rules/index.d.mts +0 -17
- package/dist/plugins/total-functions/rules/index.d.mts.map +1 -1
- package/dist/plugins/total-functions/rules/index.mjs +0 -17
- package/dist/plugins/total-functions/rules/index.mjs.map +1 -1
- package/dist/plugins/tree-shakable/plugin.mjs +0 -1
- package/dist/plugins/tree-shakable/plugin.mjs.map +1 -1
- package/dist/plugins/tree-shakable/rules/index.d.mts +0 -1
- package/dist/plugins/tree-shakable/rules/index.d.mts.map +1 -1
- package/dist/plugins/tree-shakable/rules/index.mjs +0 -1
- package/dist/plugins/tree-shakable/rules/index.mjs.map +1 -1
- package/dist/rules/eslint-import-rules.d.mts +1 -1
- package/dist/rules/eslint-import-rules.d.mts.map +1 -1
- package/dist/rules/eslint-import-rules.mjs +3 -2
- package/dist/rules/eslint-import-rules.mjs.map +1 -1
- package/dist/types/define-config.d.mts +1 -1
- package/dist/types/define-config.d.mts.map +1 -1
- package/dist/types/rules/eslint-strict-dependencies-rules.d.mts +40 -32
- package/dist/types/rules/eslint-strict-dependencies-rules.d.mts.map +1 -1
- package/package.json +4 -3
- package/src/configs/plugins.mts +1 -4
- package/src/configs/typescript.mts +3 -1
- package/src/plugins/index.mts +1 -0
- package/src/plugins/strict-dependencies/index.mts +1 -0
- package/src/plugins/strict-dependencies/plugin.mts +7 -0
- package/src/plugins/strict-dependencies/rules/index.mts +1 -0
- package/src/plugins/strict-dependencies/rules/resolve-import-path.mts +113 -0
- package/src/plugins/strict-dependencies/rules/resolve-import-path.test.mts +258 -0
- package/src/plugins/strict-dependencies/rules/rules.mts +6 -0
- package/src/plugins/strict-dependencies/rules/strict-dependencies.mts +201 -0
- package/src/plugins/strict-dependencies/rules/strict-dependencies.test.mts +113 -0
- package/src/plugins/total-functions/rules/index.mts +0 -17
- package/src/plugins/tree-shakable/rules/index.mts +0 -1
- package/src/rules/eslint-import-rules.mts +3 -2
- package/src/types/define-config.mts +1 -1
- package/src/types/rules/eslint-strict-dependencies-rules.mts +40 -34
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugins.d.mts","sourceRoot":"","sources":["../../src/configs/plugins.mts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"plugins.d.mts","sourceRoot":"","sources":["../../src/configs/plugins.mts"],"names":[],"mappings":"AAuDA,OAAO,EAAE,KAAK,YAAY,EAAmB,MAAM,oBAAoB,CAAC;AAExE,eAAO,MAAM,OAAO,EAAE,MAAM,CACxB,oBAAoB,GACpB,YAAY,GACZ,SAAS,GACT,YAAY,GACZ,YAAY,GACZ,QAAQ,GACR,MAAM,GACN,QAAQ,GACR,UAAU,GACV,wBAAwB,GACxB,SAAS,GACT,OAAO,GACP,aAAa,GACb,eAAe,GACf,YAAY,GACZ,UAAU,GACV,qBAAqB,GACrB,iBAAiB,GACjB,iBAAiB,GACjB,SAAS,GACT,uBAAuB,GACvB,eAAe,GACf,eAAe,GACf,QAAQ,EACV,IAAI,CAAC,YAAY,EAAE,SAAS,CAAC,CAiCW,CAAC"}
|
package/dist/configs/plugins.mjs
CHANGED
|
@@ -5,7 +5,6 @@ import eslintPluginSecurity from 'eslint-plugin-security';
|
|
|
5
5
|
import eslintPluginUnicorn from 'eslint-plugin-unicorn';
|
|
6
6
|
import eslintPluginSortDestructureKeys from 'eslint-plugin-sort-destructure-keys';
|
|
7
7
|
import eslintPluginImport from 'eslint-plugin-import';
|
|
8
|
-
import eslintPluginStrictDependencies from 'eslint-plugin-strict-dependencies';
|
|
9
8
|
import eslintPluginJest from 'eslint-plugin-jest';
|
|
10
9
|
import eslintPluginVitest from 'eslint-plugin-vitest';
|
|
11
10
|
import eslintPluginTestingLibrary from 'eslint-plugin-testing-library';
|
|
@@ -20,6 +19,7 @@ import eslintPluginReactPerf from 'eslint-plugin-react-perf';
|
|
|
20
19
|
import eslintPluginJsxA11y from 'eslint-plugin-jsx-a11y';
|
|
21
20
|
import eslintPluginEslintPlugin from 'eslint-plugin-eslint-plugin';
|
|
22
21
|
import { eslintPluginCustom } from '../plugins/custom/custom.mjs';
|
|
22
|
+
import { eslintPluginStrictDependencies } from '../plugins/strict-dependencies/plugin.mjs';
|
|
23
23
|
import { eslintPluginTotalFunctions } from '../plugins/total-functions/plugin.mjs';
|
|
24
24
|
import { eslintPluginTreeShakable } from '../plugins/tree-shakable/plugin.mjs';
|
|
25
25
|
|
|
@@ -48,7 +48,6 @@ const plugins = {
|
|
|
48
48
|
'react-perf': eslintPluginReactPerf,
|
|
49
49
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
50
50
|
security: eslintPluginSecurity,
|
|
51
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
52
51
|
'strict-dependencies': eslintPluginStrictDependencies,
|
|
53
52
|
'testing-library': eslintPluginTestingLibrary,
|
|
54
53
|
'total-functions': eslintPluginTotalFunctions,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugins.mjs","sources":["../../src/configs/plugins.mts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"plugins.mjs","sources":["../../src/configs/plugins.mts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAyDO,MAAM,OAAO,GA0BhB;AACF,IAAA,oBAAoB,EAAE,gBAAgB;;AAEtC,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,MAAM,EAAE,kBAAkB;AAC1B,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,qBAAqB,EAAE,8BAA8B;AACrD,IAAA,iBAAiB,EAAE,0BAA0B;AAC7C,IAAA,iBAAiB,EAAE,0BAA0B;AAC7C,IAAA,OAAO,EAAE,mBAAmB;AAC5B,IAAA,eAAe,EAAE,wBAAwB;AACzC,IAAA,eAAe,EAAE,wBAAwB;AACzC,IAAA,MAAM,EAAE,kBAAkB;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typescript.d.mts","sourceRoot":"","sources":["../../src/configs/typescript.mts"],"names":[],"mappings":"AAcA,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,
|
|
1
|
+
{"version":3,"file":"typescript.d.mts","sourceRoot":"","sources":["../../src/configs/typescript.mts"],"names":[],"mappings":"AAcA,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,EA+EZ,CAAC"}
|
|
@@ -19,7 +19,7 @@ const eslintConfigForTypeScript = ({ files, packageDirs, tsconfigFileName, tscon
|
|
|
19
19
|
tsconfigRootDir,
|
|
20
20
|
}),
|
|
21
21
|
{
|
|
22
|
-
files: files ?? ['**/*.{ts,tsx,mts,cts}'],
|
|
22
|
+
files: files ?? ['**/*.{ts,tsx,mts,cts,js,jsx,mjs,cjs}'],
|
|
23
23
|
rules: defineKnownRules({
|
|
24
24
|
...eslintArrayFuncRules,
|
|
25
25
|
...eslintPreferArrowFunctionRules,
|
|
@@ -33,6 +33,7 @@ const eslintConfigForTypeScript = ({ files, packageDirs, tsconfigFileName, tscon
|
|
|
33
33
|
...typescriptEslintRules,
|
|
34
34
|
...eslintTreeShakableRules,
|
|
35
35
|
...eslintPluginSortDestructureKeysRules,
|
|
36
|
+
'strict-dependencies/strict-dependencies': ['error', []],
|
|
36
37
|
'import/no-extraneous-dependencies': [
|
|
37
38
|
'error',
|
|
38
39
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typescript.mjs","sources":["../../src/configs/typescript.mts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;;;;;AAiBO,MAAM,yBAAyB,GAAG,CAAC,EACxC,KAAK,EACL,WAAW,EACX,gBAAgB,EAChB,eAAe,EACf,gBAAgB,GAOhB,KACA;AACE,IAAA,GAAG,qCAAqC,CAAC;QACvC,gBAAgB;QAChB,eAAe;KAChB,CAAC;AACF,IAAA;AACE,QAAA,KAAK,EAAE,KAAK,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"typescript.mjs","sources":["../../src/configs/typescript.mts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;;;;;AAiBO,MAAM,yBAAyB,GAAG,CAAC,EACxC,KAAK,EACL,WAAW,EACX,gBAAgB,EAChB,eAAe,EACf,gBAAgB,GAOhB,KACA;AACE,IAAA,GAAG,qCAAqC,CAAC;QACvC,gBAAgB;QAChB,eAAe;KAChB,CAAC;AACF,IAAA;AACE,QAAA,KAAK,EAAE,KAAK,IAAI,CAAC,sCAAsC,CAAC;QACxD,KAAK,EAAE,gBAAgB,CAAC;AACtB,YAAA,GAAG,oBAAoB;AACvB,YAAA,GAAG,8BAA8B;AACjC,YAAA,GAAG,qBAAqB;AACxB,YAAA,GAAG,yBAAyB;AAC5B,YAAA,GAAG,kBAAkB;AACrB,YAAA,GAAG,kBAAkB;AACrB,YAAA,GAAG,WAAW;AACd,YAAA,GAAG,mBAAmB;AACtB,YAAA,GAAG,kBAAkB;AACrB,YAAA,GAAG,qBAAqB;AACxB,YAAA,GAAG,uBAAuB;AAC1B,YAAA,GAAG,oCAAoC;AAEvC,YAAA,yCAAyC,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC;AAExD,YAAA,mCAAmC,EAAE;gBACnC,OAAO;AACP,gBAAA;AACE,oBAAA,UAAU,EAAE,WAAW;AACxB,iBAAA;AACF,aAAA;YACD,IAAI,gBAAgB,KAAK;AACvB,kBAAE;AACE,oBAAA,iDAAiD,EAAE,KAAK;AACxD,oBAAA,2DAA2D,EACzD,KAAK;AACR;kBACD,EAAE,CAAC;SACR,CAAC;AACH,KAAA;AACD,IAAA;QACE,KAAK,EAAE,CAAC,uBAAuB,CAAC;QAChC,KAAK,EAAE,gBAAgB,CAAC;AACtB,YAAA,kDAAkD,EAAE,KAAK;AACzD,YAAA,4BAA4B,EAAE,KAAK;SACpC,CAAC;AACH,KAAA;AACD,IAAA;QACE,KAAK,EAAE,CAAC,qBAAqB,CAAC;QAC9B,KAAK,EAAE,gBAAgB,CAAC;AACtB,YAAA,2CAA2C,EAAE,KAAK;AAClD,YAAA,oBAAoB,EAAE,KAAK;SAC5B,CAAC;AACH,KAAA;AACD,IAAA;AACE,QAAA,KAAK,EAAE;;;;;;;;YASL,qCAAqC;YAErC,uCAAuC;YAEvC,4CAA4C;YAC5C,gDAAgD;AACjD,SAAA;QACD,KAAK,EAAE,gBAAgB,CAAC;AACtB,YAAA,0CAA0C,EAAE,KAAK;AACjD,YAAA,0BAA0B,EAAE,KAAK;AACjC,YAAA,oCAAoC,EAAE,KAAK;AAC3C,YAAA,4BAA4B,EAAE,KAAK;AACnC,YAAA,4BAA4B,EAAE,KAAK;AACnC,YAAA,kBAAkB,EAAE,KAAK;SAC1B,CAAC;AACH,KAAA;;;;;"}
|
package/dist/entry-point.mjs
CHANGED
|
@@ -37,6 +37,11 @@ export { eslintConfigForTypeScriptWithoutRules } from './configs/typescript-with
|
|
|
37
37
|
export { eslintConfigForTypeScript } from './configs/typescript.mjs';
|
|
38
38
|
export { eslintConfigForVitest } from './configs/vitest.mjs';
|
|
39
39
|
export { eslintPluginCustom } from './plugins/custom/custom.mjs';
|
|
40
|
+
import 'is-glob';
|
|
41
|
+
import 'micromatch';
|
|
42
|
+
import 'node:path';
|
|
43
|
+
import 'ts-data-forge';
|
|
44
|
+
import 'typescript';
|
|
40
45
|
export { eslintPluginTotalFunctions } from './plugins/total-functions/plugin.mjs';
|
|
41
46
|
export { eslintPluginTreeShakable } from './plugins/tree-shakable/plugin.mjs';
|
|
42
47
|
//# sourceMappingURL=entry-point.mjs.map
|
package/dist/entry-point.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entry-point.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"entry-point.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/index.mjs
CHANGED
|
@@ -12,6 +12,7 @@ export { eslintConfigForTypeScriptWithoutRules } from './configs/typescript-with
|
|
|
12
12
|
export { eslintConfigForTypeScript } from './configs/typescript.mjs';
|
|
13
13
|
export { eslintConfigForVitest } from './configs/vitest.mjs';
|
|
14
14
|
export { eslintPluginCustom } from './plugins/custom/custom.mjs';
|
|
15
|
+
export { eslintPluginStrictDependencies } from './plugins/strict-dependencies/plugin.mjs';
|
|
15
16
|
export { eslintPluginTotalFunctions } from './plugins/total-functions/plugin.mjs';
|
|
16
17
|
export { eslintPluginTreeShakable } from './plugins/tree-shakable/plugin.mjs';
|
|
17
18
|
export { eslintArrayFuncRules } from './rules/eslint-array-func-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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/plugins/index.mts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/plugins/index.mts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,iCAAiC,CAAC;AAChD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC"}
|
package/dist/plugins/index.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { eslintPluginCustom } from './custom/custom.mjs';
|
|
2
|
+
export { eslintPluginStrictDependencies } from './strict-dependencies/plugin.mjs';
|
|
2
3
|
export { eslintPluginTotalFunctions } from './total-functions/plugin.mjs';
|
|
3
4
|
export { eslintPluginTreeShakable } from './tree-shakable/plugin.mjs';
|
|
4
5
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/plugins/strict-dependencies/index.mts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.d.mts","sourceRoot":"","sources":["../../../src/plugins/strict-dependencies/plugin.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAI1D,eAAO,MAAM,8BAA8B,EAAE,IAAI,CAAC,YAAY,EAAE,SAAS,CAE/D,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { strictDependenciesRules } from './rules/rules.mjs';
|
|
2
|
+
|
|
3
|
+
// Forked from https://github.com/knowledge-work/eslint-plugin-strict-dependencies/blob/v1.3.27/index.js
|
|
4
|
+
const eslintPluginStrictDependencies = {
|
|
5
|
+
rules: strictDependenciesRules,
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export { eslintPluginStrictDependencies };
|
|
9
|
+
//# sourceMappingURL=plugin.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.mjs","sources":["../../../src/plugins/strict-dependencies/plugin.mts"],"sourcesContent":[null],"names":[],"mappings":";;AAGA;AACO,MAAM,8BAA8B,GAAkC;AAC3E,IAAA,KAAK,EAAE,uBAAuB;;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../../src/plugins/strict-dependencies/rules/index.mts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve-import-path.d.mts","sourceRoot":"","sources":["../../../../src/plugins/strict-dependencies/rules/resolve-import-path.mts"],"names":[],"mappings":"AAMA;;GAEG;AACH,eAAO,MAAM,iBAAiB,GAC5B,YAAY,MAAM,EAClB,kBAAkB,MAAM,GAAG,SAAS,EACpC,cAAc,cAAc,CAAC,MAAM,EAAE,MAAM,CAAC,KAC3C,MAqDF,CAAC"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import * as path from 'node:path';
|
|
2
|
+
import { Arr, mapNullable, isNonEmptyString } from 'ts-data-forge';
|
|
3
|
+
import * as ts from 'typescript';
|
|
4
|
+
|
|
5
|
+
// Forked from https://github.com/knowledge-work/eslint-plugin-strict-dependencies/blob/v1.3.27/strict-dependencies/resolveImportPath.js
|
|
6
|
+
/**
|
|
7
|
+
* import文のrootからのパスを求める
|
|
8
|
+
*/
|
|
9
|
+
const resolveImportPath = (importPath, relativeFilePath, pathIndexMap) => {
|
|
10
|
+
// Maps importAlias to OriginalPath
|
|
11
|
+
const mut_importAliasMap = {};
|
|
12
|
+
let mut_importPath = importPath;
|
|
13
|
+
// Load tsconfig option
|
|
14
|
+
try {
|
|
15
|
+
const tsconfigOptions = readTsConfig(process.cwd());
|
|
16
|
+
// If tsconfig file found
|
|
17
|
+
if (tsconfigOptions?.paths !== undefined) {
|
|
18
|
+
for (const [key, value] of Object.entries(tsconfigOptions.paths)) {
|
|
19
|
+
const matchedKey = Object.keys(pathIndexMap).find((k) => k === key);
|
|
20
|
+
// MEMO: pathIndexMapの指定がない場合 or 指定されているindexにアクセスしても値が得られない場合は[0]固定
|
|
21
|
+
const pathIndex = matchedKey !== undefined ? pathIndexMap[matchedKey] : 0;
|
|
22
|
+
if (Arr.isNonEmpty(value)) {
|
|
23
|
+
const pathValue = mapNullable(pathIndex, (i) => value[i]) ?? value[0];
|
|
24
|
+
mut_importAliasMap[key] =
|
|
25
|
+
tsconfigOptions.baseUrl !== undefined
|
|
26
|
+
? path.join(tsconfigOptions.baseUrl, pathValue)
|
|
27
|
+
: pathValue;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
catch {
|
|
33
|
+
// DO NOTHING
|
|
34
|
+
}
|
|
35
|
+
if (isNonEmptyString(relativeFilePath) &&
|
|
36
|
+
(mut_importPath.startsWith('./') || mut_importPath.startsWith('../'))) {
|
|
37
|
+
mut_importPath = path.join(path.dirname(relativeFilePath), mut_importPath);
|
|
38
|
+
}
|
|
39
|
+
const absolutePath = Object.keys(mut_importAliasMap).reduce(
|
|
40
|
+
// FIXME: use glob module instead of replace('*')
|
|
41
|
+
(resolvedImportPath, key) => resolvedImportPath.replace(key.replace('*', ''), mut_importAliasMap[key]?.replace('*', '') ?? ''), mut_importPath);
|
|
42
|
+
return path.normalize(absolutePath);
|
|
43
|
+
};
|
|
44
|
+
const readTsConfig = (tsconfigPath) => {
|
|
45
|
+
// プロジェクトルート探索: tsconfigPath がディレクトリならその中を探す
|
|
46
|
+
const basePath = ts.sys.directoryExists(tsconfigPath)
|
|
47
|
+
? tsconfigPath
|
|
48
|
+
: path.dirname(tsconfigPath);
|
|
49
|
+
const found = ts.findConfigFile(basePath, (filePath) => ts.sys.fileExists(filePath), ts.sys.directoryExists(tsconfigPath)
|
|
50
|
+
? 'tsconfig.json'
|
|
51
|
+
: path.basename(tsconfigPath));
|
|
52
|
+
if (found === undefined) {
|
|
53
|
+
// tsconfig not found under: ${tsconfigPath}
|
|
54
|
+
return undefined;
|
|
55
|
+
}
|
|
56
|
+
// ここで実際にパース(extends も解決)
|
|
57
|
+
const result = ts.getParsedCommandLineOfConfigFile(found,
|
|
58
|
+
/*optionsToExtend*/ {}, {
|
|
59
|
+
...ts.sys,
|
|
60
|
+
onUnRecoverableConfigFileDiagnostic: (d) => {
|
|
61
|
+
// 解析不能な診断を投げる
|
|
62
|
+
const msg = ts.flattenDiagnosticMessageText(d.messageText, '\n');
|
|
63
|
+
throw new Error(`Invalid tsconfig: ${msg}`);
|
|
64
|
+
},
|
|
65
|
+
getCurrentDirectory: () => ts.sys.getCurrentDirectory(),
|
|
66
|
+
readDirectory: (rootDir, extensions, excludes, includes, depth) => ts.sys.readDirectory(rootDir, extensions, excludes, includes, depth),
|
|
67
|
+
fileExists: (filePath) => ts.sys.fileExists(filePath),
|
|
68
|
+
readFile: (filePath) => ts.sys.readFile(filePath),
|
|
69
|
+
useCaseSensitiveFileNames: ts.sys.useCaseSensitiveFileNames,
|
|
70
|
+
});
|
|
71
|
+
if (result === undefined) {
|
|
72
|
+
// 'Failed to parse tsconfig.'
|
|
73
|
+
return undefined;
|
|
74
|
+
}
|
|
75
|
+
return result.options; // 正規化済みの compilerOptions
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
export { resolveImportPath };
|
|
79
|
+
//# sourceMappingURL=resolve-import-path.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve-import-path.mjs","sources":["../../../../src/plugins/strict-dependencies/rules/resolve-import-path.mts"],"sourcesContent":[null],"names":[],"mappings":";;;;AAIA;AAEA;;AAEG;AACI,MAAM,iBAAiB,GAAG,CAC/B,UAAkB,EAClB,gBAAoC,EACpC,YAA4C,KAClC;;IAEV,MAAM,kBAAkB,GAA2B,EAAE;IAErD,IAAI,cAAc,GAAG,UAAU;;AAG/B,IAAA,IAAI;QACF,MAAM,eAAe,GA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AQ,EAAE,QAAQ,EAAE,KAAK,CAAC;AACtE,QAAA,UAAU,EAAE,CAAC,QAAQ,KAAK,EAAE,CAAC,GAAG,CAAC,UAAU,CAAC,QAAQ,CAAC;AACrD,QAAA,QAAQ,EAAE,CAAC,QAAQ,KAAK,EAAE,CAAC,GAAG,CAAC,QAAQ,CAAC,QAAQ,CAAC;AACjD,QAAA,yBAAyB,EAAE,EAAE,CAAC,GAAG,CAAC,yBAAyB;AAC5D,KAAA,CACF;AAED,IAAA,IAAI,MAAM,KAAK,SAAS,EAAE;;AAExB,QAAA,OAAO,SAAS;IAClB;AAEA,IAAA,OAAO,MAAM,CAAC,OAAO,CAAC;AACxB,CAAC;;;;"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare const strictDependenciesRules: {
|
|
2
|
+
readonly 'strict-dependencies': import("@typescript-eslint/utils/ts-eslint").RuleModule<"forbidden-import-specifier" | "forbidden-import", readonly [readonly Readonly<{
|
|
3
|
+
module: string;
|
|
4
|
+
allowReferenceFrom: readonly string[];
|
|
5
|
+
allowSameModule?: boolean;
|
|
6
|
+
targetMembers?: readonly string[];
|
|
7
|
+
excludeTypeImportChecks?: boolean;
|
|
8
|
+
}>[]] | readonly [readonly Readonly<{
|
|
9
|
+
module: string;
|
|
10
|
+
allowReferenceFrom: readonly string[];
|
|
11
|
+
allowSameModule?: boolean;
|
|
12
|
+
targetMembers?: readonly string[];
|
|
13
|
+
excludeTypeImportChecks?: boolean;
|
|
14
|
+
}>[], Readonly<{
|
|
15
|
+
resolveRelativeImport?: boolean;
|
|
16
|
+
pathIndexMap?: ReadonlyRecord<string, number>;
|
|
17
|
+
}>], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=rules.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rules.d.mts","sourceRoot":"","sources":["../../../../src/plugins/strict-dependencies/rules/rules.mts"],"names":[],"mappings":"AAGA,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;CAEM,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rules.mjs","sources":["../../../../src/plugins/strict-dependencies/rules/rules.mts"],"sourcesContent":[null],"names":[],"mappings":";;AAGO,MAAM,uBAAuB,GAAG;AACrC,IAAA,qBAAqB,EAAE,sBAAsB;;;;;"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type TSESLint } from '@typescript-eslint/utils';
|
|
2
|
+
type RuleOptions = readonly [Dependencies] | readonly [Dependencies, Options];
|
|
3
|
+
type Dependencies = readonly Readonly<{
|
|
4
|
+
module: string;
|
|
5
|
+
allowReferenceFrom: readonly string[];
|
|
6
|
+
allowSameModule?: boolean;
|
|
7
|
+
targetMembers?: readonly string[];
|
|
8
|
+
excludeTypeImportChecks?: boolean;
|
|
9
|
+
}>[];
|
|
10
|
+
type Options = Readonly<{
|
|
11
|
+
resolveRelativeImport?: boolean;
|
|
12
|
+
pathIndexMap?: ReadonlyRecord<string, number>;
|
|
13
|
+
}>;
|
|
14
|
+
type MessageId = 'forbidden-import-specifier' | 'forbidden-import';
|
|
15
|
+
export declare const strictDependenciesRule: TSESLint.RuleModule<MessageId, RuleOptions>;
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=strict-dependencies.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"strict-dependencies.d.mts","sourceRoot":"","sources":["../../../../src/plugins/strict-dependencies/rules/strict-dependencies.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAAiB,MAAM,0BAA0B,CAAC;AAaxE,KAAK,WAAW,GAAG,SAAS,CAAC,YAAY,CAAC,GAAG,SAAS,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;AAE9E,KAAK,YAAY,GAAG,SAAS,QAAQ,CAAC;IACpC,MAAM,EAAE,MAAM,CAAC;IACf,kBAAkB,EAAE,SAAS,MAAM,EAAE,CAAC;IACtC,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,aAAa,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC,uBAAuB,CAAC,EAAE,OAAO,CAAC;CACnC,CAAC,EAAE,CAAC;AAEL,KAAK,OAAO,GAAG,QAAQ,CAAC;IACtB,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,YAAY,CAAC,EAAE,cAAc,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC/C,CAAC,CAAC;AAEH,KAAK,SAAS,GAAG,4BAA4B,GAAG,kBAAkB,CAAC;AAEnE,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,UAAU,CACtD,SAAS,EACT,WAAW,CAyJZ,CAAC"}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import isGlob from 'is-glob';
|
|
2
|
+
import mm from 'micromatch';
|
|
3
|
+
import * as path from 'node:path';
|
|
4
|
+
import { Arr, hasKey, isNotUndefined, castDeepMutable } from 'ts-data-forge';
|
|
5
|
+
import { resolveImportPath } from './resolve-import-path.mjs';
|
|
6
|
+
|
|
7
|
+
const strictDependenciesRule = {
|
|
8
|
+
meta: {
|
|
9
|
+
type: 'suggestion',
|
|
10
|
+
messages: {
|
|
11
|
+
'forbidden-import-specifier': "import specifier '{{specifiers}}' is not allowed from {{from}}.",
|
|
12
|
+
'forbidden-import': "import '{{importPath}}' is not allowed from {{from}}.",
|
|
13
|
+
},
|
|
14
|
+
schema: [
|
|
15
|
+
{
|
|
16
|
+
type: 'array',
|
|
17
|
+
items: {
|
|
18
|
+
type: 'object',
|
|
19
|
+
additionalProperties: false,
|
|
20
|
+
required: ['module', 'allowReferenceFrom'],
|
|
21
|
+
properties: {
|
|
22
|
+
module: {
|
|
23
|
+
type: 'string',
|
|
24
|
+
},
|
|
25
|
+
allowReferenceFrom: {
|
|
26
|
+
type: 'array',
|
|
27
|
+
items: {
|
|
28
|
+
type: 'string',
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
allowSameModule: {
|
|
32
|
+
type: 'boolean',
|
|
33
|
+
},
|
|
34
|
+
targetMembers: {
|
|
35
|
+
type: 'array',
|
|
36
|
+
items: {
|
|
37
|
+
type: 'string',
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
excludeTypeImportChecks: {
|
|
41
|
+
type: 'boolean',
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
type: 'object',
|
|
48
|
+
additionalProperties: false,
|
|
49
|
+
properties: {
|
|
50
|
+
resolveRelativeImport: {
|
|
51
|
+
type: 'boolean',
|
|
52
|
+
},
|
|
53
|
+
pathIndexMap: {
|
|
54
|
+
type: 'object',
|
|
55
|
+
additionalProperties: {
|
|
56
|
+
type: 'number',
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
],
|
|
62
|
+
},
|
|
63
|
+
create: (context) => {
|
|
64
|
+
const ruleOptions = context.options;
|
|
65
|
+
const dependencies = ruleOptions[0];
|
|
66
|
+
const options = Arr.isArrayAtLeastLength(ruleOptions, 2)
|
|
67
|
+
? ruleOptions[1]
|
|
68
|
+
: {};
|
|
69
|
+
const resolveRelativeImport = options.resolveRelativeImport;
|
|
70
|
+
const pathIndexMap = options.pathIndexMap ?? {};
|
|
71
|
+
return {
|
|
72
|
+
ImportDeclaration: (node) => {
|
|
73
|
+
const fileFullPath = context.filename;
|
|
74
|
+
const relativeFilePath = path.normalize(path.relative(process.cwd(), fileFullPath));
|
|
75
|
+
const importPath = resolveImportPath(node.source.value, resolveRelativeImport === true ? relativeFilePath : undefined, pathIndexMap);
|
|
76
|
+
const importedModules = node.specifiers
|
|
77
|
+
.filter((spec) => hasKey(spec, 'imported')) // NOTE: ImportSpecifierの場合はimportedが存在する
|
|
78
|
+
.map((spec) => hasKey(spec.imported, 'name') ? spec.imported.name : undefined)
|
|
79
|
+
.filter(isNotUndefined);
|
|
80
|
+
for (const dependency of dependencies) {
|
|
81
|
+
// そもそもmoduleがimportPathと一致していない場合は必ず報告しない
|
|
82
|
+
if (!isMatch(importPath, dependency.module))
|
|
83
|
+
continue;
|
|
84
|
+
/**
|
|
85
|
+
* 1. 参照元チェックをしてAllowであればそこで処理を終了する
|
|
86
|
+
* 2. targetMembersが指定されていれば、targetMembersと実際にimportしているモジュールを比較して含まれていればエラーレポートして処理を終了する
|
|
87
|
+
* 3. targetMembersが指定されていない場合は、エラー扱いなのでエラーレポートして処理を終了する
|
|
88
|
+
*/
|
|
89
|
+
const isAllowedByPath =
|
|
90
|
+
// 参照元が許可されている
|
|
91
|
+
dependency.allowReferenceFrom.some((allowPath) => isMatch(relativeFilePath, allowPath)) || // または同一モジュール間の参照が許可されている場合
|
|
92
|
+
(dependency.allowSameModule === true &&
|
|
93
|
+
isMatch(relativeFilePath, dependency.module)) ||
|
|
94
|
+
// または明示的に対象外としたtype importである場合
|
|
95
|
+
// FIXME: importKind という key は node に存在しないため修正が必要
|
|
96
|
+
(dependency.excludeTypeImportChecks === true &&
|
|
97
|
+
node.importKind === 'type');
|
|
98
|
+
if (isAllowedByPath)
|
|
99
|
+
continue;
|
|
100
|
+
if (dependency.targetMembers !== undefined) {
|
|
101
|
+
const commonImportedList = getCommonElements(dependency.targetMembers, importedModules);
|
|
102
|
+
if (commonImportedList.length > 0) {
|
|
103
|
+
context.report({
|
|
104
|
+
node: castDeepMutable(node),
|
|
105
|
+
messageId: 'forbidden-import-specifier',
|
|
106
|
+
data: {
|
|
107
|
+
specifiers: commonImportedList.join(', '),
|
|
108
|
+
from: relativeFilePath,
|
|
109
|
+
},
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
continue;
|
|
113
|
+
}
|
|
114
|
+
context.report({
|
|
115
|
+
node: castDeepMutable(node),
|
|
116
|
+
messageId: 'forbidden-import',
|
|
117
|
+
data: {
|
|
118
|
+
importPath,
|
|
119
|
+
from: relativeFilePath,
|
|
120
|
+
},
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
};
|
|
125
|
+
},
|
|
126
|
+
defaultOptions: [[]],
|
|
127
|
+
};
|
|
128
|
+
/**
|
|
129
|
+
* pathのmatcher。
|
|
130
|
+
* eslintrcで設定できる値は以下のケースを扱う
|
|
131
|
+
* - globパターン指定
|
|
132
|
+
* - globパターン以外の場合 => 前方部分一致
|
|
133
|
+
*/
|
|
134
|
+
const isMatch = (str, pattern) => isGlob(pattern) ? mm.isMatch(str, pattern) : str.startsWith(pattern);
|
|
135
|
+
// importedされた値・型名もLintのターゲットに入っている場合の検出処理
|
|
136
|
+
const getCommonElements = (arrA, arrB) => arrA.filter((element) => arrB.includes(element));
|
|
137
|
+
|
|
138
|
+
export { strictDependenciesRule };
|
|
139
|
+
//# sourceMappingURL=strict-dependencies.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"strict-dependencies.mjs","sources":["../../../../src/plugins/strict-dependencies/rules/strict-dependencies.mts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;AA8BO,MAAM,sBAAsB,GAG/B;AACF,IAAA,IAAI,EAAE;AACJ,QAAA,IAAI,EAAE,YAAY;AAClB,QAAA,QAAQ,EAAE;AACR,YAAA,4BAA4B,EAC1B,iEAAiE;AACnE,YAAA,kBAAkB,EAChB,uDAAuD;AAC1D,SAAA;AACD,QAAA,MAAM,EAAE;AACN,YAAA;AACE,gBAAA,IAAI,EAAE,OAAO;AACb,gBAAA,KAAK,EAAE;AACL,oBAAA,IAAI,EAAE,QAAQ;AACd,oBAAA,oBAAoB,EAAE,KAAK;AAC3B,oBAAA,QAAQ,EAAE,CAAC,QAAQ,EAAE,oBAAoB,CAAC;AAC1C,oBAAA,UAAU,EAAE;AACV,wBAAA,MAAM,EAAE;AACN,4BAAA,IAAI,EAAE,QAAQ;AACf,yBAAA;AACD,wBAAA,kBAAkB,EAAE;AAClB,4BAAA,IAA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eAAe,CAChB;AACD,wBAAA,IAAI,kBAAkB,CAAC,MAAM,GAAG,CAAC,EAAE;4BACjC,OAAO,CAAC,MAAM,CAAC;AACb,gCAAA,IAAI,EAAE,eAAe,CAAC,IAAI,CAAC;AAC3B,gCAAA,SAAS,EAAE,4BAA4B;AACvC,gCAAA,IAAI,EAAE;AACJ,oCAAA,UAAU,EAAE,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC;AACzC,oCAAA,IAAI,EAAE,gBAAgB;AACvB,iCAAA;AACF,6BAAA,CAAC;wBACJ;wBACA;oBACF;oBAEA,OAAO,CAAC,MAAM,CAAC;AACb,wBAAA,IAAI,EAAE,eAAe,CAAC,IAAI,CAAC;AAC3B,wBAAA,SAAS,EAAE,kBAAkB;AAC7B,wBAAA,IAAI,EAAE;4BACJ,UAAU;AACV,4BAAA,IAAI,EAAE,gBAAgB;AACvB,yBAAA;AACF,qBAAA,CAAC;gBACJ;YACF,CAAC;SACF;IACH,CAAC;IACD,cAAc,EAAE,CAAC,EAAE,CAAC;;AAGtB;;;;;AAKG;AACH,MAAM,OAAO,GAAG,CAAC,GAAW,EAAE,OAAe,KAC3C,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,OAAO,CAAC,GAAG,GAAG,CAAC,UAAU,CAAC,OAAO,CAAC;AAEtE;AACA,MAAM,iBAAiB,GAAG,CACxB,IAAkB,EAClB,IAAkB,KACD,IAAI,CAAC,MAAM,CAAC,CAAC,OAAO,KAAK,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;;;;"}
|
|
@@ -1,22 +1,4 @@
|
|
|
1
|
-
import './rules/common.mjs';
|
|
2
|
-
import './rules/no-enums.mjs';
|
|
3
|
-
import './rules/no-hidden-type-assertions.mjs';
|
|
4
|
-
import './rules/no-nested-fp-ts-effects.mjs';
|
|
5
|
-
import './rules/no-partial-array-reduce.mjs';
|
|
6
|
-
import './rules/no-partial-division.mjs';
|
|
7
|
-
import './rules/no-partial-string-normalize.mjs';
|
|
8
|
-
import './rules/no-partial-url-constructor.mjs';
|
|
9
|
-
import './rules/no-premature-fp-ts-effects.mjs';
|
|
10
|
-
import './rules/no-unsafe-enum-assignment.mjs';
|
|
11
|
-
import './rules/no-unsafe-mutable-readonly-assignment.mjs';
|
|
12
|
-
import './rules/no-unsafe-optional-property-assignment.mjs';
|
|
13
|
-
import './rules/no-unsafe-readonly-mutable-assignment.mjs';
|
|
14
|
-
import './rules/no-unsafe-type-assertion.mjs';
|
|
15
|
-
import './rules/require-strict-mode.mjs';
|
|
16
1
|
import { totalFunctionsRules } from './rules/rules.mjs';
|
|
17
|
-
import '@sindresorhus/is';
|
|
18
|
-
import '@typescript-eslint/utils';
|
|
19
|
-
import 'is-immutable-type';
|
|
20
2
|
|
|
21
3
|
// forked from https://github.com/danielnixon/eslint-plugin-total-functions v7.1.0
|
|
22
4
|
const eslintPluginTotalFunctions = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.mjs","sources":["../../../src/plugins/total-functions/plugin.mts"],"sourcesContent":[null],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"plugin.mjs","sources":["../../../src/plugins/total-functions/plugin.mts"],"sourcesContent":[null],"names":[],"mappings":";;AAGA;AAEO,MAAM,0BAA0B,GAAkC;AACvE,IAAA,KAAK,EAAE,mBAAmB;;;;;"}
|
|
@@ -1,19 +1,2 @@
|
|
|
1
|
-
export * from './common.mjs';
|
|
2
|
-
export * from './fp-ts.mjs';
|
|
3
|
-
export * from './no-enums.mjs';
|
|
4
|
-
export * from './no-hidden-type-assertions.mjs';
|
|
5
|
-
export * from './no-nested-fp-ts-effects.mjs';
|
|
6
|
-
export * from './no-partial-array-reduce.mjs';
|
|
7
|
-
export * from './no-partial-division.mjs';
|
|
8
|
-
export * from './no-partial-string-normalize.mjs';
|
|
9
|
-
export * from './no-partial-url-constructor.mjs';
|
|
10
|
-
export * from './no-premature-fp-ts-effects.mjs';
|
|
11
|
-
export * from './no-unsafe-enum-assignment.mjs';
|
|
12
|
-
export * from './no-unsafe-mutable-readonly-assignment.mjs';
|
|
13
|
-
export * from './no-unsafe-optional-property-assignment.mjs';
|
|
14
|
-
export * from './no-unsafe-readonly-mutable-assignment.mjs';
|
|
15
|
-
export * from './no-unsafe-type-assertion.mjs';
|
|
16
|
-
export * from './require-strict-mode.mjs';
|
|
17
1
|
export * from './rules.mjs';
|
|
18
|
-
export * from './unsafe-assignment-rule.mjs';
|
|
19
2
|
//# sourceMappingURL=index.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../../src/plugins/total-functions/rules/index.mts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../../src/plugins/total-functions/rules/index.mts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC"}
|
|
@@ -1,19 +1,2 @@
|
|
|
1
|
-
export { assignableTypePairs, createRule, isLiteral, typeSymbolName } from './common.mjs';
|
|
2
|
-
export { effects, fpTsEffectType } from './fp-ts.mjs';
|
|
3
|
-
export { noEnums } from './no-enums.mjs';
|
|
4
|
-
export { noHiddenTypeAssertions } from './no-hidden-type-assertions.mjs';
|
|
5
|
-
export { noNestedFpTsEffects } from './no-nested-fp-ts-effects.mjs';
|
|
6
|
-
export { noPartialArrayReduce } from './no-partial-array-reduce.mjs';
|
|
7
|
-
export { noPartialDivision } from './no-partial-division.mjs';
|
|
8
|
-
export { noPartialStringNormalize } from './no-partial-string-normalize.mjs';
|
|
9
|
-
export { noPartialUrlConstructor } from './no-partial-url-constructor.mjs';
|
|
10
|
-
export { noPrematureFpTsEffects } from './no-premature-fp-ts-effects.mjs';
|
|
11
|
-
export { noUnsafeEnumAssignment } from './no-unsafe-enum-assignment.mjs';
|
|
12
|
-
export { noUnsafeMutableReadonlyAssignment } from './no-unsafe-mutable-readonly-assignment.mjs';
|
|
13
|
-
export { noUnsafeOptionalPropertyAssignment } from './no-unsafe-optional-property-assignment.mjs';
|
|
14
|
-
export { noUnsafeReadonlyMutableAssignment } from './no-unsafe-readonly-mutable-assignment.mjs';
|
|
15
|
-
export { noUnsafeTypeAssertion } from './no-unsafe-type-assertion.mjs';
|
|
16
|
-
export { requireStrictMode } from './require-strict-mode.mjs';
|
|
17
1
|
export { totalFunctionsRules } from './rules.mjs';
|
|
18
|
-
export { createNoUnsafeAssignmentRule, getSafeTypeImmutability } from './unsafe-assignment-rule.mjs';
|
|
19
2
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.mjs","sources":["../../../src/plugins/tree-shakable/plugin.mts"],"sourcesContent":[null],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"plugin.mjs","sources":["../../../src/plugins/tree-shakable/plugin.mts"],"sourcesContent":[null],"names":[],"mappings":";;AAGA;AAEO,MAAM,wBAAwB,GAAkC;AACrE,IAAA,KAAK,EAAE,iBAAiB;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../../src/plugins/tree-shakable/rules/index.mts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../../src/plugins/tree-shakable/rules/index.mts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|