@exbotanical/eslint-config 1.0.0 → 1.0.1
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/index.d.ts +3 -2
- package/dist/index.js +20 -22
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -1952,6 +1952,7 @@ type Rules = RuleOptions;
|
|
|
1952
1952
|
type FlatConfigRecord = Omit<Linter.Config<Linter.RulesRecord & Rules>, 'plugins'> & {
|
|
1953
1953
|
plugins?: Record<string, any>;
|
|
1954
1954
|
};
|
|
1955
|
+
type Awaitable<T> = T | Promise<T>;
|
|
1955
1956
|
|
|
1956
1957
|
interface OptionsIgnores extends AllOptions {
|
|
1957
1958
|
files?: string[];
|
|
@@ -2101,6 +2102,6 @@ interface OptionsStyle {
|
|
|
2101
2102
|
}
|
|
2102
2103
|
|
|
2103
2104
|
type LinterOptions = OptionsConfig;
|
|
2104
|
-
declare function exbotanical({ javascript: optionsJavascript, ignores: optionsIgnore, jsonc: optionsJsonc, markdown: optionsMarkdown, toml: optionsToml, yaml: optionsYaml, test: optionsTest, formatter, typescript: optionsTypescript, style: optionsStyle, react: optionsReact, vue: optionsVue,
|
|
2105
|
+
declare function exbotanical({ javascript: optionsJavascript, ignores: optionsIgnore, jsonc: optionsJsonc, markdown: optionsMarkdown, toml: optionsToml, yaml: optionsYaml, test: optionsTest, formatter, typescript: optionsTypescript, style: optionsStyle, react: optionsReact, vue: optionsVue, type, }: LinterOptions, ...userConfigs: Awaitable<FlatConfigRecord | FlatConfigRecord[] | Linter.Config[]>[]): Promise<FlatConfigRecord[]>;
|
|
2105
2106
|
|
|
2106
|
-
export { type AllOptions, type FlatConfigRecord, type OptionsConfig, type OptionsFiles, type OptionsHasTypeScript, type OptionsOverrides, type OptionsProjectType, type OptionsStyle, type OptionsTypeScriptParser, type Rules, exbotanical as default };
|
|
2107
|
+
export { type AllOptions, type Awaitable, type FlatConfigRecord, type OptionsConfig, type OptionsFiles, type OptionsHasTypeScript, type OptionsOverrides, type OptionsProjectType, type OptionsStyle, type OptionsTypeScriptParser, type Rules, exbotanical as default };
|
package/dist/index.js
CHANGED
|
@@ -254,7 +254,8 @@ async function javascript({ overrides = {} } = {}) {
|
|
|
254
254
|
"no-dupe-else-if": ["error"],
|
|
255
255
|
"no-dupe-keys": ["error"],
|
|
256
256
|
"no-duplicate-case": ["error"],
|
|
257
|
-
|
|
257
|
+
// See `import` ruleset
|
|
258
|
+
"no-duplicate-imports": ["off"],
|
|
258
259
|
"no-empty-character-class": ["error"],
|
|
259
260
|
"no-empty-pattern": ["error"],
|
|
260
261
|
"no-unsafe-finally": ["error"],
|
|
@@ -2050,19 +2051,19 @@ async function exbotanical({
|
|
|
2050
2051
|
style: optionsStyle = STYLE_DEFAULTS,
|
|
2051
2052
|
react: optionsReact,
|
|
2052
2053
|
vue: optionsVue,
|
|
2053
|
-
|
|
2054
|
-
}) {
|
|
2054
|
+
type
|
|
2055
|
+
}, ...userConfigs) {
|
|
2055
2056
|
const configs2 = [
|
|
2056
2057
|
perfectionist(),
|
|
2057
2058
|
unicorn(),
|
|
2058
2059
|
comments(),
|
|
2059
2060
|
imports(),
|
|
2060
|
-
javascript({ ...optionsJavascript,
|
|
2061
|
+
javascript({ ...optionsJavascript, type }),
|
|
2061
2062
|
jsdoc(),
|
|
2062
2063
|
jsx(),
|
|
2063
2064
|
node(),
|
|
2064
2065
|
regexpr(),
|
|
2065
|
-
test({ ...factoryConfig(optionsTest)
|
|
2066
|
+
test({ ...factoryConfig(optionsTest) })
|
|
2066
2067
|
];
|
|
2067
2068
|
if (optionsJsonc) {
|
|
2068
2069
|
configs2.push(
|
|
@@ -2070,41 +2071,38 @@ async function exbotanical({
|
|
|
2070
2071
|
tsconfig(),
|
|
2071
2072
|
jsonc({
|
|
2072
2073
|
...factoryConfig(optionsJsonc),
|
|
2073
|
-
...optionsStyle
|
|
2074
|
-
...otherOptions
|
|
2074
|
+
...optionsStyle
|
|
2075
2075
|
})
|
|
2076
2076
|
);
|
|
2077
2077
|
}
|
|
2078
2078
|
if (optionsMarkdown) {
|
|
2079
|
-
configs2.push(
|
|
2080
|
-
markdown({ ...factoryConfig(optionsMarkdown), ...otherOptions })
|
|
2081
|
-
);
|
|
2079
|
+
configs2.push(markdown({ ...factoryConfig(optionsMarkdown) }));
|
|
2082
2080
|
}
|
|
2083
2081
|
if (optionsReact) {
|
|
2084
|
-
configs2.push(react({ ...factoryConfig(optionsReact)
|
|
2082
|
+
configs2.push(react({ ...factoryConfig(optionsReact) }));
|
|
2085
2083
|
}
|
|
2086
2084
|
if (optionsToml) {
|
|
2087
|
-
configs2.push(
|
|
2088
|
-
toml({ ...factoryConfig(optionsToml), ...optionsStyle, ...otherOptions })
|
|
2089
|
-
);
|
|
2085
|
+
configs2.push(toml({ ...factoryConfig(optionsToml), ...optionsStyle }));
|
|
2090
2086
|
}
|
|
2091
2087
|
if (optionsTypescript) {
|
|
2092
|
-
configs2.push(
|
|
2093
|
-
typescript({ ...factoryConfig(optionsTypescript), ...otherOptions })
|
|
2094
|
-
);
|
|
2088
|
+
configs2.push(typescript({ ...factoryConfig(optionsTypescript), type }));
|
|
2095
2089
|
}
|
|
2096
2090
|
if (optionsVue) {
|
|
2097
|
-
configs2.push(vue({ ...factoryConfig(optionsVue)
|
|
2091
|
+
configs2.push(vue({ ...factoryConfig(optionsVue) }));
|
|
2098
2092
|
}
|
|
2099
2093
|
if (optionsYaml) {
|
|
2100
|
-
configs2.push(
|
|
2101
|
-
yaml({ ...factoryConfig(optionsYaml), ...optionsStyle, ...otherOptions })
|
|
2102
|
-
);
|
|
2094
|
+
configs2.push(yaml({ ...factoryConfig(optionsYaml), ...optionsStyle }));
|
|
2103
2095
|
}
|
|
2104
2096
|
if (formatter) {
|
|
2105
2097
|
configs2.push(prettier());
|
|
2106
2098
|
}
|
|
2107
|
-
configs2.push(disables(), ignores({ ...optionsIgnore
|
|
2099
|
+
configs2.push(disables(), ignores({ ...optionsIgnore }));
|
|
2100
|
+
if (userConfigs.length > 0) {
|
|
2101
|
+
const resolved2 = await Promise.all(userConfigs);
|
|
2102
|
+
configs2.push(
|
|
2103
|
+
...resolved2.map((r) => Promise.resolve(Array.isArray(r) ? r : [r]))
|
|
2104
|
+
);
|
|
2105
|
+
}
|
|
2108
2106
|
const resolved = await Promise.all(configs2);
|
|
2109
2107
|
return resolved.flat();
|
|
2110
2108
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exbotanical/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.1",
|
|
5
5
|
"private": false,
|
|
6
6
|
"description": "Zito's eslint config",
|
|
7
7
|
"author": "Matthew Zito <exbotanical@protonmail.com> (https://github.com/exbotanical/)",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"prepack": "npm run build",
|
|
35
35
|
"prepare": "simple-git-hooks",
|
|
36
36
|
"typecheck": "tsc --noEmit",
|
|
37
|
-
"release": "npm publish"
|
|
37
|
+
"release": "bumpp && npm publish"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
40
|
"@eslint-react/eslint-plugin": "^1.30.1",
|