Last active
February 22, 2026 17:21
-
-
Save w3cj/21b1f1b4857ecd13d076075a5c5aaf13 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Run this command to generate base config and vs code settings: | |
| // pnpm dlx @antfu/eslint-config@latest | |
| import antfu from "@antfu/eslint-config"; | |
| export default antfu({ | |
| type: "app", | |
| typescript: true, | |
| formatters: true, | |
| stylistic: { | |
| indent: 2, | |
| semi: true, | |
| quotes: "double", | |
| }, | |
| }, { | |
| rules: { | |
| "ts/no-redeclare": "off", | |
| "ts/consistent-type-definitions": ["error", "type"], | |
| "no-console": ["warn"], | |
| "antfu/no-top-level-await": ["off"], | |
| "node/prefer-global/process": ["off"], | |
| "node/no-process-env": ["error"], | |
| "perfectionist/sort-imports": ["error", { | |
| tsconfigRootDir: '.', | |
| }], | |
| "unicorn/filename-case": ["error", { | |
| case: "kebabCase", | |
| ignore: ["README.md"], | |
| }], | |
| }, | |
| }); |
<3 it
With this config, I’m getting these errors:
Oops! Something went wrong! :(
ESLint: 10.0.0
Error: Key "rules": Key "perfectionist/sort-imports":
Value {"tsconfigRootDir":"."} should NOT have additional properties.
Unexpected property "tsconfigRootDir". Expected properties: "fallbackSort", "type", "specialCharacters", "ignoreCase", "alphabet", "locales", "order", "sortBy", "customGroups", "newlinesInside", "groups", "newlinesBetween", "tsconfig", "maxLineLength", "sortSideEffects", "environment", "useExperimentalDependencyDetection", "partitionByComment", "partitionByNewLine", "internalPattern".and
Oops! Something went wrong! :(
ESLint: 10.0.0
A configuration object specifies rule "node/no-process-env", but could not find plugin "node".
Common causes of this problem include:
1. The "node" plugin is not defined in your configuration file.
2. The "node" plugin is not defined within the same configuration object in which the "node/no-process-env" rule is applied.My hacky fix:
export default antfu(
{
...
},
{
rules: {
...,
'node/prefer-global/process': ['off'],
'node/no-process-env': ['off'],
'perfectionist/sort-imports': [
'error',
// {
// tsconfigRootDir: '.',
// },
],
...,
},
}
);reference: antfu/eslint-config#817
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ty so much