Skip to content

Commit a541490

Browse files
committed
feat: more work on the configs
Signed-off-by: prisis <[email protected]>
1 parent 77a22fa commit a541490

File tree

7 files changed

+370
-89
lines changed

7 files changed

+370
-89
lines changed

packages/eslint-config/scripts/typegen.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ import unicorn from "../src/config/plugins/unicorn";
3838
import validateJsxNesting from "../src/config/plugins/validate-jsx-nesting";
3939
import vitest from "../src/config/plugins/vitest";
4040
import yaml from "../src/config/plugins/yml";
41+
import youDontNeedLodashUnderscore from "../src/config/plugins/you-dont-need-lodash-underscore";
4142
import style from "../src/config/style";
4243
import variables from "../src/config/variables";
4344
import combine from "../src/utils/combine";
@@ -98,6 +99,7 @@ const configs = await combine(
9899
node({
99100
packageJson: fakePackageJson,
100101
}),
102+
youDontNeedLodashUnderscore({}),
101103
// solid({),
102104
sortPackageJson({}),
103105
stylistic({}),
Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,19 @@
1-
import type { Linter } from "eslint";
2-
1+
import type { OptionsFiles } from "../../types";
32
import { createConfig } from "../../utils/create-config";
3+
import interopDefault from "../../utils/interop-default";
44

5-
const config: Linter.Config = createConfig("all", {
6-
plugins: ["es-x"],
7-
settings: {
8-
es: { aggressive: true },
9-
},
10-
});
5+
export default createConfig<OptionsFiles>("all", async (config, oFiles) => {
6+
const { files = oFiles } = config;
117

12-
export default config;
8+
const pluginES = await interopDefault(import("eslint-plugin-es"));
9+
10+
return [
11+
{
12+
files,
13+
name: "anolilab/es/setup",
14+
plugins: {
15+
"es-x": pluginES,
16+
},
17+
},
18+
];
19+
});

packages/eslint-config/src/config/plugins/etc.ts

Lines changed: 0 additions & 32 deletions
This file was deleted.

packages/eslint-config/src/config/plugins/javascript.ts

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -50,28 +50,26 @@ export default createConfig<OptionsPackageJson>("js", async (config) => {
5050
},
5151
eslintJs.configs.recommended,
5252
{
53-
env: {
54-
commonjs: true,
55-
},
5653
files: ["**/*.cjs"],
57-
// inside *.cjs files. restore commonJS "globals"
58-
globals: {
59-
__dirname: true,
60-
__filename: true,
61-
exports: true,
62-
require: true,
54+
languageOptions: {
55+
// inside *.cjs files. restore commonJS "globals"
56+
globals: {
57+
__dirname: true,
58+
__filename: true,
59+
exports: true,
60+
require: true,
61+
},
6362
},
6463
},
6564
{
66-
env: {
67-
commonjs: false,
68-
},
6965
files: ["**/*.mjs"],
70-
globals: {
71-
__dirname: "off",
72-
__filename: "off",
73-
exports: "off",
74-
require: "off",
66+
languageOptions: {
67+
globals: {
68+
__dirname: "off",
69+
__filename: "off",
70+
exports: "off",
71+
require: "off",
72+
},
7573
},
7674
},
7775
];

packages/eslint-config/src/config/plugins/react.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,6 @@ export default createConfig<
9898
},
9999
},
100100
{
101-
env: {
102-
browser: true,
103-
},
104101
files,
105102
name: "anolilab/react/rules",
106103
parserOptions: {

0 commit comments

Comments
 (0)