@kazupon/eslint-config 0.27.0 → 0.28.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/README.md +2 -0
- package/dist/index.d.ts +1792 -13
- package/dist/index.js +58 -1
- package/package.json +2 -1
package/dist/index.js
CHANGED
|
@@ -7,6 +7,10 @@ import { mergeProcessors, processorPassThrough } from "eslint-merge-processors";
|
|
|
7
7
|
//#region src/config.ts
|
|
8
8
|
function defineConfig(...configs) {
|
|
9
9
|
const baseConfigs = [];
|
|
10
|
+
/**
|
|
11
|
+
* built-in configurations
|
|
12
|
+
* baseConfigs.push(javascript().then(c => c))
|
|
13
|
+
*/
|
|
10
14
|
return new FlatConfigComposer().append(...baseConfigs, ...configs);
|
|
11
15
|
}
|
|
12
16
|
|
|
@@ -345,6 +349,11 @@ function jsoncSort() {
|
|
|
345
349
|
async function markdown(options = {}) {
|
|
346
350
|
const { rules: overrideRules = {}, files = [GLOB_MARKDOWN], blockExtensions = [] } = options;
|
|
347
351
|
const language = options.language || "gfm";
|
|
352
|
+
/**
|
|
353
|
+
* TODO: remove this option
|
|
354
|
+
* const fencedCodeBlocks =
|
|
355
|
+
* typeof options.fencedCodeBlocks === 'boolean' ? options.fencedCodeBlocks : true
|
|
356
|
+
*/
|
|
348
357
|
const markdown$1 = await loadPlugin("@eslint/markdown");
|
|
349
358
|
const recommended = { ...markdown$1.configs["recommended"][0] };
|
|
350
359
|
const codeblocks = markdown$1.configs.processor[2];
|
|
@@ -436,6 +445,14 @@ async function react(options = {}) {
|
|
|
436
445
|
files: getGlobSourceFiles(useTypeScript),
|
|
437
446
|
...reactRefresh?.configs.recommended
|
|
438
447
|
});
|
|
448
|
+
/**
|
|
449
|
+
* if (enableA11y) {
|
|
450
|
+
* configs.push({
|
|
451
|
+
* files: getFiles(),
|
|
452
|
+
* ...reactA11y.flatConfigs.recommended
|
|
453
|
+
* })
|
|
454
|
+
* }
|
|
455
|
+
*/
|
|
439
456
|
return [...configs, customConfig];
|
|
440
457
|
}
|
|
441
458
|
|
|
@@ -454,6 +471,46 @@ async function regexp(options = {}) {
|
|
|
454
471
|
}];
|
|
455
472
|
}
|
|
456
473
|
|
|
474
|
+
//#endregion
|
|
475
|
+
//#region src/configs/stylistic.ts
|
|
476
|
+
async function stylistic(options = {}) {
|
|
477
|
+
const { rules: overrideRules = {}, customize = {
|
|
478
|
+
commaDangle: "never",
|
|
479
|
+
blockSpacing: true,
|
|
480
|
+
quoteProps: "as-needed",
|
|
481
|
+
pluginName: "@stylistic"
|
|
482
|
+
} } = options;
|
|
483
|
+
const stylistic$1 = await loadPlugin("@stylistic/eslint-plugin");
|
|
484
|
+
const config = stylistic$1.configs.customize(customize);
|
|
485
|
+
return [{
|
|
486
|
+
name: "@stylistic/eslint-plugin",
|
|
487
|
+
files: [GLOB_SRC, `${GLOB_MARKDOWN}/${GLOB_SRC}`],
|
|
488
|
+
plugins: { [customize.pluginName]: stylistic$1 },
|
|
489
|
+
rules: {
|
|
490
|
+
...config.rules,
|
|
491
|
+
"@stylistic/brace-style": "off",
|
|
492
|
+
"@stylistic/arrow-parens": ["error", "as-needed"],
|
|
493
|
+
"@stylistic/lines-around-comment": ["error", {
|
|
494
|
+
beforeBlockComment: true,
|
|
495
|
+
beforeLineComment: true,
|
|
496
|
+
allowBlockStart: true,
|
|
497
|
+
allowObjectStart: true,
|
|
498
|
+
allowArrayStart: true,
|
|
499
|
+
allowClassStart: true,
|
|
500
|
+
allowEnumStart: true,
|
|
501
|
+
allowInterfaceStart: true,
|
|
502
|
+
allowModuleStart: true,
|
|
503
|
+
allowTypeStart: true
|
|
504
|
+
}],
|
|
505
|
+
"@stylistic/spaced-comment": ["error"],
|
|
506
|
+
"@stylistic/multiline-comment-style": ["error", "separate-lines"]
|
|
507
|
+
}
|
|
508
|
+
}, {
|
|
509
|
+
name: "@kazupon/@stylistic/overrides",
|
|
510
|
+
rules: { ...overrideRules }
|
|
511
|
+
}];
|
|
512
|
+
}
|
|
513
|
+
|
|
457
514
|
//#endregion
|
|
458
515
|
//#region src/configs/svelte.ts
|
|
459
516
|
async function svelte(options = {}) {
|
|
@@ -716,4 +773,4 @@ async function yml(options = {}) {
|
|
|
716
773
|
const yaml = yml;
|
|
717
774
|
|
|
718
775
|
//#endregion
|
|
719
|
-
export { comments, css, defineConfig, imports, javascript, jsdoc, jsonc, markdown, md, prettier, promise, react, regexp, svelte, toml, typescript, unicorn, vitest, vue, yaml, yml };
|
|
776
|
+
export { comments, css, defineConfig, imports, javascript, jsdoc, jsonc, markdown, md, prettier, promise, react, regexp, stylistic, svelte, toml, typescript, unicorn, vitest, vue, yaml, yml };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kazupon/eslint-config",
|
|
3
3
|
"description": "ESLint config for @kazupon",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.28.0",
|
|
5
5
|
"author": {
|
|
6
6
|
"email": "kawakazu80@gmail.com",
|
|
7
7
|
"name": "kazuya kawaguchi"
|
|
@@ -52,6 +52,7 @@
|
|
|
52
52
|
"@eslint-community/eslint-plugin-eslint-comments": "^4.4.1",
|
|
53
53
|
"@eslint/js": "^9.22.0",
|
|
54
54
|
"@kazupon/jts-utils": "^0.6.0",
|
|
55
|
+
"@stylistic/eslint-plugin": "^4.2.0",
|
|
55
56
|
"eslint-flat-config-utils": "^2.0.1",
|
|
56
57
|
"eslint-merge-processors": "^2.0.0",
|
|
57
58
|
"globals": "^16.0.0"
|