@vp-tw/eslint-config 0.0.17 → 0.0.19
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 +0 -31
- package/dist/configs/mdx.d.ts +1 -2
- package/dist/configs/prettier.d.ts +1 -2
- package/dist/configs/reactCompiler.d.ts +23 -0
- package/dist/configs/reactCompiler.js +31 -0
- package/dist/configs/storybook.d.ts +1 -2
- package/dist/eslint-typegen.d.ts +4 -7
- package/dist/esm/configs/mdx.d.ts +1 -2
- package/dist/esm/configs/prettier.d.ts +1 -2
- package/dist/esm/configs/reactCompiler.d.ts +23 -0
- package/dist/esm/configs/reactCompiler.mjs +25 -0
- package/dist/esm/configs/storybook.d.ts +1 -2
- package/dist/esm/eslint-typegen.d.ts +4 -7
- package/dist/esm/extends/imports.d.ts +2 -2
- package/dist/esm/extends/javascript.d.ts +2 -2
- package/dist/esm/extends/jsonc.d.ts +2 -2
- package/dist/esm/extends/react.d.ts +5 -4
- package/dist/esm/extends/react.mjs +8 -22
- package/dist/esm/extends/typescript.d.ts +2 -2
- package/dist/esm/extends/yaml.d.ts +2 -2
- package/dist/esm/types.d.ts +11 -2
- package/dist/esm/vdustr.d.ts +2 -3
- package/dist/esm/vdustr.mjs +1 -2
- package/dist/extends/imports.d.ts +2 -2
- package/dist/extends/javascript.d.ts +2 -2
- package/dist/extends/jsonc.d.ts +2 -2
- package/dist/extends/react.d.ts +5 -4
- package/dist/extends/react.js +5 -13
- package/dist/extends/typescript.d.ts +2 -2
- package/dist/extends/yaml.d.ts +2 -2
- package/dist/types.d.ts +11 -2
- package/dist/vdustr.d.ts +2 -3
- package/dist/vdustr.js +1 -2
- package/package.json +15 -17
- package/dist/eslint-typegen.js +0 -2
- package/dist/esm/eslint-typegen.mjs +0 -1
package/README.md
CHANGED
|
@@ -46,37 +46,6 @@ export default vdustr(
|
|
|
46
46
|
);
|
|
47
47
|
```
|
|
48
48
|
|
|
49
|
-
## Known Issues
|
|
50
|
-
|
|
51
|
-
## `RulesRecord` Type Definition Not Applied
|
|
52
|
-
|
|
53
|
-
If the rule record type definitions are not applied correctly, the plugin rules
|
|
54
|
-
supported by this ESLint config may not appear in properties that rely on these
|
|
55
|
-
types, such as `overrides`.
|
|
56
|
-
|
|
57
|
-
For example, you might not see the rule key `react-compiler/react-compiler` as
|
|
58
|
-
expected.
|
|
59
|
-
|
|
60
|
-
To fix this, you may need to prevent the outdated package `@types/eslint` from
|
|
61
|
-
being installed. This can be done by creating a `.pnpmfile.cjs` file:
|
|
62
|
-
|
|
63
|
-
```js
|
|
64
|
-
// .pnpmfile.cjs
|
|
65
|
-
module.exports = {
|
|
66
|
-
hooks: {
|
|
67
|
-
readPackage(pkg) {
|
|
68
|
-
if (pkg.dependencies) {
|
|
69
|
-
delete pkg.dependencies["@types/eslint"];
|
|
70
|
-
}
|
|
71
|
-
return pkg;
|
|
72
|
-
},
|
|
73
|
-
},
|
|
74
|
-
};
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
- [ESLint v9.10.0 released - Types now included](https://eslint.org/blog/2024/09/eslint-v9.10.0-released/#types-now-included)
|
|
78
|
-
- [feat: Add types #18854](https://github.com/eslint/eslint/pull/18854)
|
|
79
|
-
|
|
80
49
|
## License
|
|
81
50
|
|
|
82
51
|
MIT © ViPro <vdustr@gmail.com> (<http://vdustr.dev>)
|
package/dist/configs/mdx.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type { TypedFlatConfigItem } from "
|
|
2
|
-
import type { ConfigOverrides, ResolveConfigNamesMap } from "../types";
|
|
1
|
+
import type { ConfigOverrides, ResolveConfigNamesMap, TypedFlatConfigItem } from "../types";
|
|
3
2
|
declare const configNamesMapSource: {
|
|
4
3
|
readonly setup: "vdustr/mdx/setup";
|
|
5
4
|
readonly processor: "vdustr/mdx/processor";
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type { TypedFlatConfigItem } from "
|
|
2
|
-
import type { ConfigOverrides, ResolveConfigNamesMap } from "../types";
|
|
1
|
+
import type { ConfigOverrides, ResolveConfigNamesMap, TypedFlatConfigItem } from "../types";
|
|
3
2
|
declare const configNamesMapSource: {
|
|
4
3
|
readonly rules: "vdustr/prettier/rules";
|
|
5
4
|
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { ConfigOverrides, ResolveConfigNamesMap, TypedFlatConfigItem } from "../types";
|
|
2
|
+
declare const configNamesMapSource: {
|
|
3
|
+
readonly setup: "vdustr/react/react-compiler/setup";
|
|
4
|
+
readonly rules: "vdustr/react/react-compiler/rules";
|
|
5
|
+
};
|
|
6
|
+
declare module "../types" {
|
|
7
|
+
interface ConfigNamesMap extends ResolveConfigNamesMap<reactCompiler.ConfigNamesMapSource> {
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
declare namespace reactCompiler {
|
|
11
|
+
type ConfigNamesMapSource = typeof configNamesMapSource;
|
|
12
|
+
interface Options {
|
|
13
|
+
setup?: ConfigOverrides;
|
|
14
|
+
reactCompiler?: ConfigOverrides;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
declare const reactCompiler: ((options?: reactCompiler.Options) => Promise<TypedFlatConfigItem[]>) & {
|
|
18
|
+
configNamesMapSource: {
|
|
19
|
+
readonly setup: "vdustr/react/react-compiler/setup";
|
|
20
|
+
readonly rules: "vdustr/react/react-compiler/rules";
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
export { reactCompiler };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.reactCompiler = void 0;
|
|
7
|
+
var _defu = _interopRequireDefault(require("defu"));
|
|
8
|
+
var _eslintPluginReactCompiler = require("../lib/eslint-plugin-react-compiler");
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
+
const configNamesMapSource = {
|
|
11
|
+
setup: "vdustr/react/react-compiler/setup",
|
|
12
|
+
rules: "vdustr/react/react-compiler/rules"
|
|
13
|
+
};
|
|
14
|
+
const reactCompilerInternal = async options => {
|
|
15
|
+
const reactCompilerSetupConfig = (0, _defu.default)(options?.setup, {
|
|
16
|
+
name: configNamesMapSource.setup,
|
|
17
|
+
plugins: {
|
|
18
|
+
"react-compiler": await (0, _eslintPluginReactCompiler.reactCompiler)()
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
const reactCompilerRulesConfig = (0, _defu.default)(options?.reactCompiler, {
|
|
22
|
+
name: configNamesMapSource.rules,
|
|
23
|
+
rules: {
|
|
24
|
+
"react-compiler/react-compiler": "error"
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
return [reactCompilerSetupConfig, reactCompilerRulesConfig];
|
|
28
|
+
};
|
|
29
|
+
const reactCompiler = exports.reactCompiler = Object.assign(reactCompilerInternal, {
|
|
30
|
+
configNamesMapSource
|
|
31
|
+
});
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type { TypedFlatConfigItem } from "
|
|
2
|
-
import type { ConfigOverrides, ResolveConfigNamesMap } from "../types";
|
|
1
|
+
import type { ConfigOverrides, ResolveConfigNamesMap, TypedFlatConfigItem } from "../types";
|
|
3
2
|
declare const configNamesMapSource: {
|
|
4
3
|
readonly setup: "vdustr/stroybook/setup";
|
|
5
4
|
readonly storiesRules: "vdustr/storybook/stories/rules";
|
package/dist/eslint-typegen.d.ts
CHANGED
|
@@ -2,12 +2,6 @@
|
|
|
2
2
|
/* prettier-ignore */
|
|
3
3
|
import type { Linter } from 'eslint'
|
|
4
4
|
|
|
5
|
-
declare module 'eslint' {
|
|
6
|
-
namespace Linter {
|
|
7
|
-
interface RulesRecord extends RuleOptions {}
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
|
|
11
5
|
export interface RuleOptions {
|
|
12
6
|
/**
|
|
13
7
|
* Linter integration with remark plugins
|
|
@@ -103,4 +97,7 @@ type StorybookNoUninstalledAddons = []|[{
|
|
|
103
97
|
packageJsonLocation?: string
|
|
104
98
|
ignore?: string[]
|
|
105
99
|
[k: string]: unknown | undefined
|
|
106
|
-
}]
|
|
100
|
+
}]
|
|
101
|
+
// Names of all the configs
|
|
102
|
+
export type ConfigNames = 'vdustr/mdx/setup' | 'vdustr/mdx/processor' | 'vdustr/mdx/rules' | 'vdustr/mdx/code-blocks' | 'vdustr/prettier/rules' | 'vdustr/react/react-compiler/setup' | 'vdustr/react/react-compiler/rules' | 'vdustr/stroybook/setup' | 'vdustr/storybook/stories/rules' | 'vdustr/storybook/main/rules'
|
|
103
|
+
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type { TypedFlatConfigItem } from "
|
|
2
|
-
import type { ConfigOverrides, ResolveConfigNamesMap } from "../types";
|
|
1
|
+
import type { ConfigOverrides, ResolveConfigNamesMap, TypedFlatConfigItem } from "../types";
|
|
3
2
|
declare const configNamesMapSource: {
|
|
4
3
|
readonly setup: "vdustr/mdx/setup";
|
|
5
4
|
readonly processor: "vdustr/mdx/processor";
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type { TypedFlatConfigItem } from "
|
|
2
|
-
import type { ConfigOverrides, ResolveConfigNamesMap } from "../types";
|
|
1
|
+
import type { ConfigOverrides, ResolveConfigNamesMap, TypedFlatConfigItem } from "../types";
|
|
3
2
|
declare const configNamesMapSource: {
|
|
4
3
|
readonly rules: "vdustr/prettier/rules";
|
|
5
4
|
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { ConfigOverrides, ResolveConfigNamesMap, TypedFlatConfigItem } from "../types";
|
|
2
|
+
declare const configNamesMapSource: {
|
|
3
|
+
readonly setup: "vdustr/react/react-compiler/setup";
|
|
4
|
+
readonly rules: "vdustr/react/react-compiler/rules";
|
|
5
|
+
};
|
|
6
|
+
declare module "../types" {
|
|
7
|
+
interface ConfigNamesMap extends ResolveConfigNamesMap<reactCompiler.ConfigNamesMapSource> {
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
declare namespace reactCompiler {
|
|
11
|
+
type ConfigNamesMapSource = typeof configNamesMapSource;
|
|
12
|
+
interface Options {
|
|
13
|
+
setup?: ConfigOverrides;
|
|
14
|
+
reactCompiler?: ConfigOverrides;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
declare const reactCompiler: ((options?: reactCompiler.Options) => Promise<TypedFlatConfigItem[]>) & {
|
|
18
|
+
configNamesMapSource: {
|
|
19
|
+
readonly setup: "vdustr/react/react-compiler/setup";
|
|
20
|
+
readonly rules: "vdustr/react/react-compiler/rules";
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
export { reactCompiler };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import defu from "defu";
|
|
2
|
+
import { reactCompiler as importLib } from "../lib/eslint-plugin-react-compiler.mjs";
|
|
3
|
+
const configNamesMapSource = {
|
|
4
|
+
setup: "vdustr/react/react-compiler/setup",
|
|
5
|
+
rules: "vdustr/react/react-compiler/rules"
|
|
6
|
+
};
|
|
7
|
+
const reactCompilerInternal = async (options) => {
|
|
8
|
+
const reactCompilerSetupConfig = defu(options?.setup, {
|
|
9
|
+
name: configNamesMapSource.setup,
|
|
10
|
+
plugins: {
|
|
11
|
+
"react-compiler": await importLib()
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
const reactCompilerRulesConfig = defu(options?.reactCompiler, {
|
|
15
|
+
name: configNamesMapSource.rules,
|
|
16
|
+
rules: {
|
|
17
|
+
"react-compiler/react-compiler": "error"
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
return [reactCompilerSetupConfig, reactCompilerRulesConfig];
|
|
21
|
+
};
|
|
22
|
+
const reactCompiler = Object.assign(reactCompilerInternal, {
|
|
23
|
+
configNamesMapSource
|
|
24
|
+
});
|
|
25
|
+
export { reactCompiler };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type { TypedFlatConfigItem } from "
|
|
2
|
-
import type { ConfigOverrides, ResolveConfigNamesMap } from "../types";
|
|
1
|
+
import type { ConfigOverrides, ResolveConfigNamesMap, TypedFlatConfigItem } from "../types";
|
|
3
2
|
declare const configNamesMapSource: {
|
|
4
3
|
readonly setup: "vdustr/stroybook/setup";
|
|
5
4
|
readonly storiesRules: "vdustr/storybook/stories/rules";
|
|
@@ -2,12 +2,6 @@
|
|
|
2
2
|
/* prettier-ignore */
|
|
3
3
|
import type { Linter } from 'eslint'
|
|
4
4
|
|
|
5
|
-
declare module 'eslint' {
|
|
6
|
-
namespace Linter {
|
|
7
|
-
interface RulesRecord extends RuleOptions {}
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
|
|
11
5
|
export interface RuleOptions {
|
|
12
6
|
/**
|
|
13
7
|
* Linter integration with remark plugins
|
|
@@ -103,4 +97,7 @@ type StorybookNoUninstalledAddons = []|[{
|
|
|
103
97
|
packageJsonLocation?: string
|
|
104
98
|
ignore?: string[]
|
|
105
99
|
[k: string]: unknown | undefined
|
|
106
|
-
}]
|
|
100
|
+
}]
|
|
101
|
+
// Names of all the configs
|
|
102
|
+
export type ConfigNames = 'vdustr/mdx/setup' | 'vdustr/mdx/processor' | 'vdustr/mdx/rules' | 'vdustr/mdx/code-blocks' | 'vdustr/prettier/rules' | 'vdustr/react/react-compiler/setup' | 'vdustr/react/react-compiler/rules' | 'vdustr/stroybook/setup' | 'vdustr/storybook/stories/rules' | 'vdustr/storybook/main/rules'
|
|
103
|
+
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { ConfigNames
|
|
1
|
+
import type { ConfigNames } from "@antfu/eslint-config";
|
|
2
2
|
import type { FlatConfigComposer } from "eslint-flat-config-utils";
|
|
3
|
-
import type { ConfigOverrides, ResolveConfigNamesMap } from "../types";
|
|
3
|
+
import type { ConfigOverrides, ResolveConfigNamesMap, TypedFlatConfigItem } from "../types";
|
|
4
4
|
declare const configNamesMapSource: {
|
|
5
5
|
readonly imports: "vdustr/imports/rules";
|
|
6
6
|
readonly noDefaultExport: "vdustr/imports/no-default-export/rules";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { ConfigNames
|
|
1
|
+
import type { ConfigNames } from "@antfu/eslint-config";
|
|
2
2
|
import type { FlatConfigComposer } from "eslint-flat-config-utils";
|
|
3
|
-
import type { ConfigOverrides, ResolveConfigNamesMap } from "../types";
|
|
3
|
+
import type { ConfigOverrides, ResolveConfigNamesMap, TypedFlatConfigItem } from "../types";
|
|
4
4
|
declare const configNamesMapSource: {
|
|
5
5
|
readonly javascript: "vdustr/javascript/rules";
|
|
6
6
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { ConfigNames
|
|
1
|
+
import type { ConfigNames } from "@antfu/eslint-config";
|
|
2
2
|
import type { FlatConfigComposer } from "eslint-flat-config-utils";
|
|
3
|
-
import type { ConfigOverrides, ResolveConfigNamesMap } from "../types";
|
|
3
|
+
import type { ConfigOverrides, ResolveConfigNamesMap, TypedFlatConfigItem } from "../types";
|
|
4
4
|
declare const configNamesMapSource: {
|
|
5
5
|
readonly jsonc: "vdustr/jsonc/rules";
|
|
6
6
|
readonly sortArrayValues: "vdustr/jsonc/sort-array-values/rules";
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import type { ConfigNames
|
|
1
|
+
import type { ConfigNames } from "@antfu/eslint-config";
|
|
2
2
|
import type { FlatConfigComposer } from "eslint-flat-config-utils";
|
|
3
|
-
import type { ConfigOverrides, ResolveConfigNamesMap } from "../types";
|
|
3
|
+
import type { ConfigOverrides, ResolveConfigNamesMap, TypedFlatConfigItem } from "../types";
|
|
4
|
+
import { reactCompiler } from "../configs/reactCompiler";
|
|
4
5
|
declare const configNamesMapSource: {
|
|
5
6
|
readonly react: "vdustr/react/rules";
|
|
6
7
|
readonly reactCompilerSetup: "vdustr/react/react-compiler/setup";
|
|
@@ -14,8 +15,8 @@ declare namespace react {
|
|
|
14
15
|
type ConfigNamesMapSource = typeof configNamesMapSource;
|
|
15
16
|
interface Options {
|
|
16
17
|
react?: ConfigOverrides;
|
|
17
|
-
|
|
18
|
-
|
|
18
|
+
reactCompiler?: reactCompiler.Options["reactCompiler"];
|
|
19
|
+
reactCompilerSetup?: reactCompiler.Options["setup"];
|
|
19
20
|
}
|
|
20
21
|
}
|
|
21
22
|
declare const react: ((composer: FlatConfigComposer<TypedFlatConfigItem, ConfigNames>, options?: react.Options) => void) & {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import defu from "defu";
|
|
2
2
|
import { omit, pick } from "es-toolkit";
|
|
3
|
-
import { reactCompiler } from "../
|
|
3
|
+
import { reactCompiler } from "../configs/reactCompiler.mjs";
|
|
4
4
|
import { extendsConfig } from "../utils/extendsConfig.mjs";
|
|
5
5
|
import { ignoreKeys } from "./_utils.mjs";
|
|
6
6
|
const configNamesMapSource = {
|
|
@@ -22,28 +22,14 @@ const reactInternal = (composer, options) => {
|
|
|
22
22
|
},
|
|
23
23
|
omittedConfig
|
|
24
24
|
);
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
const reactCompilerConfigs = await reactCompiler({
|
|
26
|
+
setup: options?.reactCompilerSetup ?? {},
|
|
27
|
+
reactCompiler: defu(
|
|
28
|
+
options?.reactCompiler,
|
|
29
|
+
pick(omittedConfig, ["files", "ignores"])
|
|
30
|
+
)
|
|
30
31
|
});
|
|
31
|
-
|
|
32
|
-
options?.reactCompilerRules,
|
|
33
|
-
{
|
|
34
|
-
name: configNamesMapSource.reactCompilerRules,
|
|
35
|
-
rules: {
|
|
36
|
-
"react-compiler/react-compiler": "error"
|
|
37
|
-
}
|
|
38
|
-
},
|
|
39
|
-
omittedConfig
|
|
40
|
-
);
|
|
41
|
-
return [
|
|
42
|
-
modifiedConfig,
|
|
43
|
-
rulesConfig,
|
|
44
|
-
reactCompilerSetupConfig,
|
|
45
|
-
reactCompilerRulesConfig
|
|
46
|
-
];
|
|
32
|
+
return [modifiedConfig, rulesConfig, ...reactCompilerConfigs];
|
|
47
33
|
});
|
|
48
34
|
};
|
|
49
35
|
const react = Object.assign(reactInternal, {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { ConfigNames
|
|
1
|
+
import type { ConfigNames } from "@antfu/eslint-config";
|
|
2
2
|
import type { FlatConfigComposer } from "eslint-flat-config-utils";
|
|
3
|
-
import type { ConfigOverrides, ResolveConfigNamesMap } from "../types";
|
|
3
|
+
import type { ConfigOverrides, ResolveConfigNamesMap, TypedFlatConfigItem } from "../types";
|
|
4
4
|
declare const configNamesMapSource: {
|
|
5
5
|
readonly typescript: "vdustr/typescript/rules";
|
|
6
6
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { ConfigNames
|
|
1
|
+
import type { ConfigNames } from "@antfu/eslint-config";
|
|
2
2
|
import type { FlatConfigComposer } from "eslint-flat-config-utils";
|
|
3
|
-
import type { ConfigOverrides, ResolveConfigNamesMap } from "../types";
|
|
3
|
+
import type { ConfigOverrides, ResolveConfigNamesMap, TypedFlatConfigItem } from "../types";
|
|
4
4
|
declare const configNamesMapSource: {
|
|
5
5
|
readonly yaml: "vdustr/yaml/rules";
|
|
6
6
|
readonly sortKeys: "vdustr/yaml/sort-keys/rules";
|
package/dist/esm/types.d.ts
CHANGED
|
@@ -1,7 +1,16 @@
|
|
|
1
|
-
import type { TypedFlatConfigItem } from "@antfu/eslint-config";
|
|
2
1
|
import type antfu from "@antfu/eslint-config";
|
|
2
|
+
import type { Rules as AntfuEslintRules } from "@antfu/eslint-config";
|
|
3
3
|
import type { DistributiveOmit } from "@mui/types";
|
|
4
|
+
import type { Linter } from "eslint";
|
|
5
|
+
import type { RuleOptions } from "./eslint-typegen";
|
|
4
6
|
type Config = NonNullable<Parameters<typeof antfu>[1]>;
|
|
7
|
+
type Rules = RuleOptions & AntfuEslintRules;
|
|
8
|
+
/**
|
|
9
|
+
* Learned from <https://github.com/antfu/eslint-config/blob/e283983/src/types.ts#L11-L23>
|
|
10
|
+
*/
|
|
11
|
+
type TypedFlatConfigItem = Omit<Linter.Config<Linter.RulesRecord & Rules>, "plugins"> & {
|
|
12
|
+
plugins?: Record<string, any>;
|
|
13
|
+
};
|
|
5
14
|
/**
|
|
6
15
|
* A map of config names.
|
|
7
16
|
*
|
|
@@ -34,4 +43,4 @@ type ResolveConfigNamesMap<TSource extends BaseConfigNamesMapSource> = {
|
|
|
34
43
|
};
|
|
35
44
|
interface ConfigOverrides extends DistributiveOmit<TypedFlatConfigItem, "process"> {
|
|
36
45
|
}
|
|
37
|
-
export type { BaseConfigNamesMapSource, Config, ConfigNamesMap, ConfigOverrides, ResolveConfigNamesMap, };
|
|
46
|
+
export type { BaseConfigNamesMapSource, Config, ConfigNamesMap, ConfigOverrides, ResolveConfigNamesMap, TypedFlatConfigItem, };
|
package/dist/esm/vdustr.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { ConfigNames
|
|
1
|
+
import type { ConfigNames } from "@antfu/eslint-config";
|
|
2
2
|
import type { FlatConfigComposer } from "eslint-flat-config-utils";
|
|
3
|
-
import type { Config, ConfigNamesMap } from "./types";
|
|
3
|
+
import type { Config, ConfigNamesMap, TypedFlatConfigItem } from "./types";
|
|
4
4
|
import antfu from "@antfu/eslint-config";
|
|
5
5
|
import { mdx } from "./configs/mdx";
|
|
6
6
|
import { prettier } from "./configs/prettier";
|
|
@@ -11,7 +11,6 @@ import { jsonc } from "./extends/jsonc";
|
|
|
11
11
|
import { react } from "./extends/react";
|
|
12
12
|
import { typescript } from "./extends/typescript";
|
|
13
13
|
import { yaml } from "./extends/yaml";
|
|
14
|
-
import "./eslint-typegen";
|
|
15
14
|
type Options = NonNullable<Parameters<typeof antfu>[0]> & {
|
|
16
15
|
javascriptExtends?: javascript.Options;
|
|
17
16
|
importsExtends?: imports.Options;
|
package/dist/esm/vdustr.mjs
CHANGED
|
@@ -8,10 +8,9 @@ import { jsonc } from "./extends/jsonc.mjs";
|
|
|
8
8
|
import { react } from "./extends/react.mjs";
|
|
9
9
|
import { typescript } from "./extends/typescript.mjs";
|
|
10
10
|
import { yaml } from "./extends/yaml.mjs";
|
|
11
|
-
import "./eslint-typegen.mjs";
|
|
12
11
|
const vdustr = (options, ...userConfigs) => {
|
|
13
12
|
let config = antfu({
|
|
14
|
-
//
|
|
13
|
+
// Use `prettier` for formatting by default.
|
|
15
14
|
stylistic: false,
|
|
16
15
|
...options
|
|
17
16
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { ConfigNames
|
|
1
|
+
import type { ConfigNames } from "@antfu/eslint-config";
|
|
2
2
|
import type { FlatConfigComposer } from "eslint-flat-config-utils";
|
|
3
|
-
import type { ConfigOverrides, ResolveConfigNamesMap } from "../types";
|
|
3
|
+
import type { ConfigOverrides, ResolveConfigNamesMap, TypedFlatConfigItem } from "../types";
|
|
4
4
|
declare const configNamesMapSource: {
|
|
5
5
|
readonly imports: "vdustr/imports/rules";
|
|
6
6
|
readonly noDefaultExport: "vdustr/imports/no-default-export/rules";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { ConfigNames
|
|
1
|
+
import type { ConfigNames } from "@antfu/eslint-config";
|
|
2
2
|
import type { FlatConfigComposer } from "eslint-flat-config-utils";
|
|
3
|
-
import type { ConfigOverrides, ResolveConfigNamesMap } from "../types";
|
|
3
|
+
import type { ConfigOverrides, ResolveConfigNamesMap, TypedFlatConfigItem } from "../types";
|
|
4
4
|
declare const configNamesMapSource: {
|
|
5
5
|
readonly javascript: "vdustr/javascript/rules";
|
|
6
6
|
};
|
package/dist/extends/jsonc.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { ConfigNames
|
|
1
|
+
import type { ConfigNames } from "@antfu/eslint-config";
|
|
2
2
|
import type { FlatConfigComposer } from "eslint-flat-config-utils";
|
|
3
|
-
import type { ConfigOverrides, ResolveConfigNamesMap } from "../types";
|
|
3
|
+
import type { ConfigOverrides, ResolveConfigNamesMap, TypedFlatConfigItem } from "../types";
|
|
4
4
|
declare const configNamesMapSource: {
|
|
5
5
|
readonly jsonc: "vdustr/jsonc/rules";
|
|
6
6
|
readonly sortArrayValues: "vdustr/jsonc/sort-array-values/rules";
|
package/dist/extends/react.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import type { ConfigNames
|
|
1
|
+
import type { ConfigNames } from "@antfu/eslint-config";
|
|
2
2
|
import type { FlatConfigComposer } from "eslint-flat-config-utils";
|
|
3
|
-
import type { ConfigOverrides, ResolveConfigNamesMap } from "../types";
|
|
3
|
+
import type { ConfigOverrides, ResolveConfigNamesMap, TypedFlatConfigItem } from "../types";
|
|
4
|
+
import { reactCompiler } from "../configs/reactCompiler";
|
|
4
5
|
declare const configNamesMapSource: {
|
|
5
6
|
readonly react: "vdustr/react/rules";
|
|
6
7
|
readonly reactCompilerSetup: "vdustr/react/react-compiler/setup";
|
|
@@ -14,8 +15,8 @@ declare namespace react {
|
|
|
14
15
|
type ConfigNamesMapSource = typeof configNamesMapSource;
|
|
15
16
|
interface Options {
|
|
16
17
|
react?: ConfigOverrides;
|
|
17
|
-
|
|
18
|
-
|
|
18
|
+
reactCompiler?: reactCompiler.Options["reactCompiler"];
|
|
19
|
+
reactCompilerSetup?: reactCompiler.Options["setup"];
|
|
19
20
|
}
|
|
20
21
|
}
|
|
21
22
|
declare const react: ((composer: FlatConfigComposer<TypedFlatConfigItem, ConfigNames>, options?: react.Options) => void) & {
|
package/dist/extends/react.js
CHANGED
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.react = void 0;
|
|
7
7
|
var _defu = _interopRequireDefault(require("defu"));
|
|
8
8
|
var _esToolkit = require("es-toolkit");
|
|
9
|
-
var
|
|
9
|
+
var _reactCompiler = require("../configs/reactCompiler");
|
|
10
10
|
var _extendsConfig = require("../utils/extendsConfig");
|
|
11
11
|
var _utils = require("./_utils");
|
|
12
12
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -25,19 +25,11 @@ const reactInternal = (composer, options) => {
|
|
|
25
25
|
"react/prefer-destructuring-assignment": "off"
|
|
26
26
|
}
|
|
27
27
|
}, omittedConfig);
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
"react-compiler": await (0, _eslintPluginReactCompiler.reactCompiler)()
|
|
32
|
-
}
|
|
28
|
+
const reactCompilerConfigs = await (0, _reactCompiler.reactCompiler)({
|
|
29
|
+
setup: options?.reactCompilerSetup ?? {},
|
|
30
|
+
reactCompiler: (0, _defu.default)(options?.reactCompiler, (0, _esToolkit.pick)(omittedConfig, ["files", "ignores"]))
|
|
33
31
|
});
|
|
34
|
-
|
|
35
|
-
name: configNamesMapSource.reactCompilerRules,
|
|
36
|
-
rules: {
|
|
37
|
-
"react-compiler/react-compiler": "error"
|
|
38
|
-
}
|
|
39
|
-
}, omittedConfig);
|
|
40
|
-
return [modifiedConfig, rulesConfig, reactCompilerSetupConfig, reactCompilerRulesConfig];
|
|
32
|
+
return [modifiedConfig, rulesConfig, ...reactCompilerConfigs];
|
|
41
33
|
});
|
|
42
34
|
};
|
|
43
35
|
const react = exports.react = Object.assign(reactInternal, {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { ConfigNames
|
|
1
|
+
import type { ConfigNames } from "@antfu/eslint-config";
|
|
2
2
|
import type { FlatConfigComposer } from "eslint-flat-config-utils";
|
|
3
|
-
import type { ConfigOverrides, ResolveConfigNamesMap } from "../types";
|
|
3
|
+
import type { ConfigOverrides, ResolveConfigNamesMap, TypedFlatConfigItem } from "../types";
|
|
4
4
|
declare const configNamesMapSource: {
|
|
5
5
|
readonly typescript: "vdustr/typescript/rules";
|
|
6
6
|
};
|
package/dist/extends/yaml.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { ConfigNames
|
|
1
|
+
import type { ConfigNames } from "@antfu/eslint-config";
|
|
2
2
|
import type { FlatConfigComposer } from "eslint-flat-config-utils";
|
|
3
|
-
import type { ConfigOverrides, ResolveConfigNamesMap } from "../types";
|
|
3
|
+
import type { ConfigOverrides, ResolveConfigNamesMap, TypedFlatConfigItem } from "../types";
|
|
4
4
|
declare const configNamesMapSource: {
|
|
5
5
|
readonly yaml: "vdustr/yaml/rules";
|
|
6
6
|
readonly sortKeys: "vdustr/yaml/sort-keys/rules";
|
package/dist/types.d.ts
CHANGED
|
@@ -1,7 +1,16 @@
|
|
|
1
|
-
import type { TypedFlatConfigItem } from "@antfu/eslint-config";
|
|
2
1
|
import type antfu from "@antfu/eslint-config";
|
|
2
|
+
import type { Rules as AntfuEslintRules } from "@antfu/eslint-config";
|
|
3
3
|
import type { DistributiveOmit } from "@mui/types";
|
|
4
|
+
import type { Linter } from "eslint";
|
|
5
|
+
import type { RuleOptions } from "./eslint-typegen";
|
|
4
6
|
type Config = NonNullable<Parameters<typeof antfu>[1]>;
|
|
7
|
+
type Rules = RuleOptions & AntfuEslintRules;
|
|
8
|
+
/**
|
|
9
|
+
* Learned from <https://github.com/antfu/eslint-config/blob/e283983/src/types.ts#L11-L23>
|
|
10
|
+
*/
|
|
11
|
+
type TypedFlatConfigItem = Omit<Linter.Config<Linter.RulesRecord & Rules>, "plugins"> & {
|
|
12
|
+
plugins?: Record<string, any>;
|
|
13
|
+
};
|
|
5
14
|
/**
|
|
6
15
|
* A map of config names.
|
|
7
16
|
*
|
|
@@ -34,4 +43,4 @@ type ResolveConfigNamesMap<TSource extends BaseConfigNamesMapSource> = {
|
|
|
34
43
|
};
|
|
35
44
|
interface ConfigOverrides extends DistributiveOmit<TypedFlatConfigItem, "process"> {
|
|
36
45
|
}
|
|
37
|
-
export type { BaseConfigNamesMapSource, Config, ConfigNamesMap, ConfigOverrides, ResolveConfigNamesMap, };
|
|
46
|
+
export type { BaseConfigNamesMapSource, Config, ConfigNamesMap, ConfigOverrides, ResolveConfigNamesMap, TypedFlatConfigItem, };
|
package/dist/vdustr.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { ConfigNames
|
|
1
|
+
import type { ConfigNames } from "@antfu/eslint-config";
|
|
2
2
|
import type { FlatConfigComposer } from "eslint-flat-config-utils";
|
|
3
|
-
import type { Config, ConfigNamesMap } from "./types";
|
|
3
|
+
import type { Config, ConfigNamesMap, TypedFlatConfigItem } from "./types";
|
|
4
4
|
import antfu from "@antfu/eslint-config";
|
|
5
5
|
import { mdx } from "./configs/mdx";
|
|
6
6
|
import { prettier } from "./configs/prettier";
|
|
@@ -11,7 +11,6 @@ import { jsonc } from "./extends/jsonc";
|
|
|
11
11
|
import { react } from "./extends/react";
|
|
12
12
|
import { typescript } from "./extends/typescript";
|
|
13
13
|
import { yaml } from "./extends/yaml";
|
|
14
|
-
import "./eslint-typegen";
|
|
15
14
|
type Options = NonNullable<Parameters<typeof antfu>[0]> & {
|
|
16
15
|
javascriptExtends?: javascript.Options;
|
|
17
16
|
importsExtends?: imports.Options;
|
package/dist/vdustr.js
CHANGED
|
@@ -14,11 +14,10 @@ var _jsonc = require("./extends/jsonc");
|
|
|
14
14
|
var _react = require("./extends/react");
|
|
15
15
|
var _typescript = require("./extends/typescript");
|
|
16
16
|
var _yaml = require("./extends/yaml");
|
|
17
|
-
require("./eslint-typegen");
|
|
18
17
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
19
18
|
const vdustr = (options, ...userConfigs) => {
|
|
20
19
|
let config = (0, _eslintConfig.default)({
|
|
21
|
-
//
|
|
20
|
+
// Use `prettier` for formatting by default.
|
|
22
21
|
stylistic: false,
|
|
23
22
|
...options
|
|
24
23
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vp-tw/eslint-config",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.19",
|
|
4
4
|
"description": "ViPro's ESLint configuration",
|
|
5
5
|
"homepage": "https://github.com/vdustr/eslint-config",
|
|
6
6
|
"author": {
|
|
@@ -9,23 +9,23 @@
|
|
|
9
9
|
},
|
|
10
10
|
"exports": {
|
|
11
11
|
".": {
|
|
12
|
-
"default": {
|
|
13
|
-
"default": "./dist/index.js",
|
|
14
|
-
"types": "./dist/index.d.ts"
|
|
15
|
-
},
|
|
16
12
|
"import": {
|
|
17
|
-
"
|
|
18
|
-
"
|
|
13
|
+
"types": "./dist/esm/index.d.ts",
|
|
14
|
+
"default": "./dist/esm/index.mjs"
|
|
15
|
+
},
|
|
16
|
+
"default": {
|
|
17
|
+
"types": "./dist/index.d.ts",
|
|
18
|
+
"default": "./dist/index.js"
|
|
19
19
|
}
|
|
20
20
|
},
|
|
21
21
|
"./*": {
|
|
22
|
-
"default": {
|
|
23
|
-
"default": "./dist/*.js",
|
|
24
|
-
"types": "./dist/*.d.ts"
|
|
25
|
-
},
|
|
26
22
|
"import": {
|
|
27
|
-
"
|
|
28
|
-
"
|
|
23
|
+
"types": "./dist/esm/*.d.ts",
|
|
24
|
+
"default": "./dist/esm/*.mjs"
|
|
25
|
+
},
|
|
26
|
+
"default": {
|
|
27
|
+
"types": "./dist/*.d.ts",
|
|
28
|
+
"default": "./dist/*.js"
|
|
29
29
|
}
|
|
30
30
|
},
|
|
31
31
|
"./README.md": "./README.md",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"eslint-config-prettier": {
|
|
67
67
|
"optional": true
|
|
68
68
|
},
|
|
69
|
-
"eslint-mdx": {
|
|
69
|
+
"eslint-plugin-mdx": {
|
|
70
70
|
"optional": true
|
|
71
71
|
},
|
|
72
72
|
"eslint-plugin-package-json": {
|
|
@@ -83,10 +83,8 @@
|
|
|
83
83
|
"access": "public"
|
|
84
84
|
},
|
|
85
85
|
"scripts": {
|
|
86
|
-
"build": "
|
|
87
|
-
"build:unbuild": "unbuild",
|
|
86
|
+
"build": "unbuild",
|
|
88
87
|
"copy": "tsx scripts/copy",
|
|
89
|
-
"fixEslintTypegenDts": "tsx scripts/fixEslintTypegenDts",
|
|
90
88
|
"typegen": "tsx scripts/typegen"
|
|
91
89
|
}
|
|
92
90
|
}
|
package/dist/eslint-typegen.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
// Placeholder for `eslint-typegen.d.ts`.
|