@w5s/eslint-config 3.12.0 → 3.13.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/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -7
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
- package/src/config/imports.ts +5 -2
- package/src/config/unicorn.ts +3 -2
- package/src/defineConfig.ts +8 -3
package/dist/index.js
CHANGED
|
@@ -548,8 +548,10 @@ async function imports(options = {}) {
|
|
|
548
548
|
const { enabled: stylisticEnabled } = StylisticConfig.from(stylistic);
|
|
549
549
|
const [importPlugin] = await Promise.all([interopDefault(import("eslint-plugin-import"))]);
|
|
550
550
|
return [{
|
|
551
|
+
name: "w5s/import/setup",
|
|
552
|
+
plugins: { import: importPlugin }
|
|
553
|
+
}, {
|
|
551
554
|
name: "w5s/import/rules",
|
|
552
|
-
plugins: { import: importPlugin },
|
|
553
555
|
rules: {
|
|
554
556
|
...recommended ? imports["recommended"] : {},
|
|
555
557
|
...stylisticEnabled ? imports["stylistic"] : {},
|
|
@@ -1150,7 +1152,7 @@ async function ts(options = {}) {
|
|
|
1150
1152
|
const defaultFiles$1 = [sourceGlob$1];
|
|
1151
1153
|
async function unicorn(options = {}) {
|
|
1152
1154
|
const [unicornPlugin] = await Promise.all([interopDefault(import("eslint-plugin-unicorn"))]);
|
|
1153
|
-
const { files
|
|
1155
|
+
const { files, recommended = true, rules = {}, stylistic = true } = options;
|
|
1154
1156
|
const { enabled: stylisticEnabled } = StylisticConfig.from(stylistic);
|
|
1155
1157
|
return [
|
|
1156
1158
|
{
|
|
@@ -1158,7 +1160,7 @@ async function unicorn(options = {}) {
|
|
|
1158
1160
|
plugins: { unicorn: unicornPlugin }
|
|
1159
1161
|
},
|
|
1160
1162
|
{
|
|
1161
|
-
files,
|
|
1163
|
+
files: withDefaultFiles(files, defaultFiles$1),
|
|
1162
1164
|
name: "w5s/unicorn/rules",
|
|
1163
1165
|
rules: {
|
|
1164
1166
|
...recommended && unicornPlugin.configs["unopinionated"].rules,
|
|
@@ -1239,19 +1241,19 @@ async function defineConfig(options = {}) {
|
|
|
1239
1241
|
stylistic: stylisticOptions,
|
|
1240
1242
|
..._options
|
|
1241
1243
|
});
|
|
1242
|
-
const toOption = (optionsOrBoolean) => withDefaultStylistic(typeof optionsOrBoolean === "boolean" ? { enabled: optionsOrBoolean } : {
|
|
1243
|
-
enabled:
|
|
1244
|
+
const toOption = (optionsOrBoolean, defaultEnabled = true) => withDefaultStylistic(typeof optionsOrBoolean === "boolean" ? { enabled: optionsOrBoolean } : optionsOrBoolean === void 0 ? { enabled: defaultEnabled } : {
|
|
1245
|
+
enabled: defaultEnabled,
|
|
1244
1246
|
...optionsOrBoolean
|
|
1245
1247
|
});
|
|
1246
1248
|
const includeEnabled = (factory, input) => input.enabled ? [factory(input)] : [];
|
|
1247
|
-
return ESLintConfig.concat(...includeEnabled(e18e, toOption(plugins.e18e)), ...includeEnabled(es, toOption(plugins.es)), ...includeEnabled(ts, toOption(plugins.ts)), ...includeEnabled(ignores, toOption(options)), ...includeEnabled(jsonc, toOption(plugins.jsonc)), ...includeEnabled(jsdoc, toOption(plugins.jsdoc)), ...includeEnabled(react, toOption(plugins.react)), ...includeEnabled(stylistic, toOption(plugins.stylistic)), ...includeEnabled(imports, toOption(plugins.import)), ...includeEnabled(markdown, toOption(plugins.markdown)), ...includeEnabled(next, toOption(plugins.next)), ...includeEnabled(node, toOption(plugins.node)), ...includeEnabled(perfectionist, toOption(plugins.perfectionist)), ...includeEnabled(unicorn, toOption(plugins.unicorn)), ...includeEnabled(yml, toOption(plugins.yml)), ...includeEnabled(test, toOption(plugins.test)), ...rules ? [{ rules }] : []);
|
|
1249
|
+
return ESLintConfig.concat(...includeEnabled(e18e, toOption(plugins.e18e)), ...includeEnabled(es, toOption(plugins.es)), ...includeEnabled(ts, toOption(plugins.ts)), ...includeEnabled(ignores, toOption(options)), ...includeEnabled(jsonc, toOption(plugins.jsonc)), ...includeEnabled(jsdoc, toOption(plugins.jsdoc)), ...includeEnabled(react, toOption(plugins.react)), ...includeEnabled(stylistic, toOption(plugins.stylistic)), ...includeEnabled(imports, toOption(plugins.import)), ...includeEnabled(markdown, toOption(plugins.markdown)), ...includeEnabled(next, toOption(plugins.next, false)), ...includeEnabled(node, toOption(plugins.node)), ...includeEnabled(perfectionist, toOption(plugins.perfectionist)), ...includeEnabled(unicorn, toOption(plugins.unicorn)), ...includeEnabled(yml, toOption(plugins.yml)), ...includeEnabled(test, toOption(plugins.test)), ...rules ? [{ rules }] : []);
|
|
1248
1250
|
}
|
|
1249
1251
|
//#endregion
|
|
1250
1252
|
//#region src/meta.ts
|
|
1251
1253
|
const meta = Object.freeze({
|
|
1252
1254
|
buildNumber: 1,
|
|
1253
1255
|
name: "@w5s/eslint-config",
|
|
1254
|
-
version: "3.
|
|
1256
|
+
version: "3.13.0"
|
|
1255
1257
|
});
|
|
1256
1258
|
//#endregion
|
|
1257
1259
|
export { StylisticConfig, defineConfig as default, defineConfig, e18e, es, ignores, imports, jsdoc, jsonc, markdown, meta, next, node, perfectionist, react, stylistic, test, ts, unicorn, yml };
|