@kazupon/eslint-config 0.40.0 → 0.42.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.mts +22 -0
- package/dist/index.mjs +23 -3
- package/package.json +17 -17
package/dist/index.d.mts
CHANGED
|
@@ -5865,6 +5865,11 @@ interface MarkdownRules {
|
|
|
5865
5865
|
*/
|
|
5866
5866
|
"markdown-preferences/no-multiple-empty-lines"?: Linter.RuleEntry<MarkdownPreferencesNoMultipleEmptyLines>;
|
|
5867
5867
|
/**
|
|
5868
|
+
* Disallow tab characters in Markdown files.
|
|
5869
|
+
* @see https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/no-tabs.html
|
|
5870
|
+
*/
|
|
5871
|
+
"markdown-preferences/no-tabs"?: Linter.RuleEntry<MarkdownPreferencesNoTabs>;
|
|
5872
|
+
/**
|
|
5868
5873
|
* disallow text backslash at the end of a line.
|
|
5869
5874
|
* @see https://ota-meshi.github.io/eslint-plugin-markdown-preferences/rules/no-text-backslash-linebreak.html
|
|
5870
5875
|
*/
|
|
@@ -6202,6 +6207,11 @@ type MarkdownPreferencesNoMultipleEmptyLines = [] | [{
|
|
|
6202
6207
|
maxEOF?: number;
|
|
6203
6208
|
maxBOF?: number;
|
|
6204
6209
|
}];
|
|
6210
|
+
type MarkdownPreferencesNoTabs = [] | [{
|
|
6211
|
+
checkTarget?: ("all" | "indentation" | "non-indentation");
|
|
6212
|
+
ignoreCodeBlocks?: string[];
|
|
6213
|
+
codeBlockTabWidth?: number;
|
|
6214
|
+
}];
|
|
6205
6215
|
type MarkdownPreferencesNoTrailingSpaces = [] | [{
|
|
6206
6216
|
skipBlankLines?: boolean;
|
|
6207
6217
|
ignoreComments?: boolean;
|
|
@@ -16701,6 +16711,10 @@ declare const md: typeof markdown;
|
|
|
16701
16711
|
//#endregion
|
|
16702
16712
|
//#region src/configs/oxlint.d.ts
|
|
16703
16713
|
/**
|
|
16714
|
+
* Oxlint configuration preset names
|
|
16715
|
+
*/
|
|
16716
|
+
type OxlintConfigPreset = "recommended" | "all" | "import" | "unicorn" | "jsdoc" | "node" | "jest" | "vitest" | "typescript" | "vue" | "react" | "react-perf" | "jsx-a11y" | "tree-shaking" | "nextjs" | "pedantic" | "style" | "correctness" | "restriction" | "suspicious";
|
|
16717
|
+
/**
|
|
16704
16718
|
* Oxlint configuration options
|
|
16705
16719
|
*/
|
|
16706
16720
|
interface OxlintOptions {
|
|
@@ -16724,6 +16738,14 @@ interface OxlintOptions {
|
|
|
16724
16738
|
* @default false
|
|
16725
16739
|
*/
|
|
16726
16740
|
enableGlobalIgnore?: boolean;
|
|
16741
|
+
/**
|
|
16742
|
+
* configuration preset name, which is one of `eslint-plugin-oxlint`'s provided presets
|
|
16743
|
+
*
|
|
16744
|
+
* @see https://github.com/oxc-project/eslint-plugin-oxlint?tab=readme-ov-file#all-configs
|
|
16745
|
+
*
|
|
16746
|
+
* @default `[]`
|
|
16747
|
+
*/
|
|
16748
|
+
presets?: OxlintConfigPreset[];
|
|
16727
16749
|
}
|
|
16728
16750
|
/**
|
|
16729
16751
|
* `eslint-plugin-oxlint` and overrides configuration options
|
package/dist/index.mjs
CHANGED
|
@@ -434,6 +434,7 @@ async function javascript(options = {}) {
|
|
|
434
434
|
*/
|
|
435
435
|
async function jsdoc(options = {}) {
|
|
436
436
|
const { rules: overrideRules = {}, ignores: overrideIgnores = [], typescript: typescript$1, error = false } = options;
|
|
437
|
+
const jsdocSettings = (options.settings || {}).jsdoc || {};
|
|
437
438
|
const jsdoc$1 = await loadPlugin("eslint-plugin-jsdoc");
|
|
438
439
|
function resolvePreset() {
|
|
439
440
|
let preset = "recommended";
|
|
@@ -500,7 +501,11 @@ async function jsdoc(options = {}) {
|
|
|
500
501
|
{ tags: { typeParam: "always" } }
|
|
501
502
|
],
|
|
502
503
|
...overrideRules
|
|
503
|
-
}
|
|
504
|
+
},
|
|
505
|
+
settings: { jsdoc: {
|
|
506
|
+
tagNamePreference: { template: "typeParam" },
|
|
507
|
+
...jsdocSettings
|
|
508
|
+
} }
|
|
504
509
|
}];
|
|
505
510
|
}
|
|
506
511
|
|
|
@@ -715,11 +720,13 @@ const md = markdown;
|
|
|
715
720
|
async function oxlint(options = {}) {
|
|
716
721
|
const { rules: overrideRules = {} } = options;
|
|
717
722
|
const enableGlobalIgnore = options.enableGlobalIgnore ?? false;
|
|
723
|
+
const presets = options.presets ?? [];
|
|
718
724
|
const oxlint$1 = await loadPlugin("eslint-plugin-oxlint");
|
|
719
725
|
const customConfig = {
|
|
720
726
|
name: "@kazupon/oxlint",
|
|
721
727
|
rules: { ...overrideRules }
|
|
722
728
|
};
|
|
729
|
+
const presetConfigs = collectOxlintPresetConfig(oxlint$1, presets);
|
|
723
730
|
if (options.configFile) {
|
|
724
731
|
const configsFromFile = oxlint$1.buildFromOxlintConfigFile(options.configFile, { withNursery: options.withNursery });
|
|
725
732
|
const oxlintBaseConfig = configsFromFile.find((config) => config.name === "oxlint/from-oxlint-config");
|
|
@@ -734,9 +741,22 @@ async function oxlint(options = {}) {
|
|
|
734
741
|
ignores
|
|
735
742
|
},
|
|
736
743
|
...configsFromFile,
|
|
744
|
+
...presetConfigs,
|
|
745
|
+
customConfig
|
|
746
|
+
] : [
|
|
747
|
+
...configsFromFile,
|
|
748
|
+
...presetConfigs,
|
|
737
749
|
customConfig
|
|
738
|
-
]
|
|
739
|
-
} else return [...
|
|
750
|
+
];
|
|
751
|
+
} else return [...presetConfigs, customConfig];
|
|
752
|
+
}
|
|
753
|
+
function collectOxlintPresetConfig(oxlint$1, presets) {
|
|
754
|
+
const results = [];
|
|
755
|
+
for (const preset of presets) {
|
|
756
|
+
const presetConfigs = oxlint$1.configs[`flat/${preset}`];
|
|
757
|
+
if (presetConfigs) results.push(presetConfigs[0]);
|
|
758
|
+
}
|
|
759
|
+
return results;
|
|
740
760
|
}
|
|
741
761
|
|
|
742
762
|
//#endregion
|
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.42.0",
|
|
5
5
|
"author": {
|
|
6
6
|
"email": "kawakazu80@gmail.com",
|
|
7
7
|
"name": "kazuya kawaguchi"
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
"eslint-import-resolver-typescript": ">=4.4.0",
|
|
70
70
|
"eslint-plugin-barrel-files": ">=3.0.1",
|
|
71
71
|
"eslint-plugin-import": ">=2.32.0",
|
|
72
|
-
"eslint-plugin-jsdoc": ">61.
|
|
72
|
+
"eslint-plugin-jsdoc": ">61.5.0",
|
|
73
73
|
"eslint-plugin-jsonc": ">=2.21.0",
|
|
74
74
|
"eslint-plugin-markdown-preferences": ">=0.36.2",
|
|
75
75
|
"eslint-plugin-module-interop": ">=0.3.0",
|
|
@@ -189,35 +189,35 @@
|
|
|
189
189
|
},
|
|
190
190
|
"devDependencies": {
|
|
191
191
|
"@eslint/compat": "^1.4.1",
|
|
192
|
-
"@eslint/css": "^0.14.
|
|
192
|
+
"@eslint/css": "^0.14.1",
|
|
193
193
|
"@eslint/markdown": "^7.5.1",
|
|
194
194
|
"@html-eslint/eslint-plugin": "^0.48.0",
|
|
195
195
|
"@intlify/eslint-plugin-vue-i18n": "^4.1.0",
|
|
196
|
-
"@kazupon/prettier-config": "^0.
|
|
196
|
+
"@kazupon/prettier-config": "^0.2.0",
|
|
197
197
|
"@types/eslint": "^9.6.1",
|
|
198
|
-
"@types/node": "^22.19.
|
|
199
|
-
"@vitest/eslint-plugin": "^1.5.
|
|
200
|
-
"bumpp": "^10.3.
|
|
198
|
+
"@types/node": "^22.19.2",
|
|
199
|
+
"@vitest/eslint-plugin": "^1.5.2",
|
|
200
|
+
"bumpp": "^10.3.2",
|
|
201
201
|
"eslint": "^9.39.1",
|
|
202
202
|
"eslint-config-prettier": "^10.1.8",
|
|
203
203
|
"eslint-import-resolver-typescript": "^4.4.4",
|
|
204
204
|
"eslint-plugin-barrel-files": "^3.0.1",
|
|
205
205
|
"eslint-plugin-import": "^2.32.0",
|
|
206
|
-
"eslint-plugin-jsdoc": "^61.
|
|
206
|
+
"eslint-plugin-jsdoc": "^61.5.0",
|
|
207
207
|
"eslint-plugin-jsonc": "^2.21.0",
|
|
208
|
-
"eslint-plugin-markdown-preferences": "^0.
|
|
208
|
+
"eslint-plugin-markdown-preferences": "^0.37.0",
|
|
209
209
|
"eslint-plugin-module-interop": "^0.3.1",
|
|
210
|
-
"eslint-plugin-oxlint": "^1.
|
|
210
|
+
"eslint-plugin-oxlint": "^1.32.0",
|
|
211
211
|
"eslint-plugin-promise": "^7.2.1",
|
|
212
212
|
"eslint-plugin-react": "^7.37.5",
|
|
213
213
|
"eslint-plugin-react-hooks": "^7.0.1",
|
|
214
214
|
"eslint-plugin-react-refresh": "^0.4.24",
|
|
215
215
|
"eslint-plugin-regexp": "^2.10.0",
|
|
216
|
-
"eslint-plugin-svelte": "^3.13.
|
|
216
|
+
"eslint-plugin-svelte": "^3.13.1",
|
|
217
217
|
"eslint-plugin-toml": "^0.12.0",
|
|
218
218
|
"eslint-plugin-unicorn": "^61.0.2",
|
|
219
219
|
"eslint-plugin-unused-imports": "^4.3.0",
|
|
220
|
-
"eslint-plugin-vue": "^10.6.
|
|
220
|
+
"eslint-plugin-vue": "^10.6.2",
|
|
221
221
|
"eslint-plugin-vue-composable": "^1.0.0",
|
|
222
222
|
"eslint-plugin-vue-scoped-css": "^2.12.0",
|
|
223
223
|
"eslint-plugin-vuejs-accessibility": "^2.4.1",
|
|
@@ -225,14 +225,14 @@
|
|
|
225
225
|
"eslint-typegen": "^2.3.0",
|
|
226
226
|
"gh-changelogen": "^0.2.8",
|
|
227
227
|
"jiti": "^2.6.1",
|
|
228
|
-
"knip": "^5.
|
|
228
|
+
"knip": "^5.73.0",
|
|
229
229
|
"lint-staged": "^16.2.7",
|
|
230
|
-
"prettier": "^3.
|
|
231
|
-
"svelte": "^5.
|
|
230
|
+
"prettier": "^3.7.4",
|
|
231
|
+
"svelte": "^5.45.8",
|
|
232
232
|
"tailwind-csstree": "^0.1.4",
|
|
233
|
-
"tsdown": "^0.16.
|
|
233
|
+
"tsdown": "^0.16.8",
|
|
234
234
|
"typescript": "^5.9.3",
|
|
235
|
-
"typescript-eslint": "^8.
|
|
235
|
+
"typescript-eslint": "^8.49.0",
|
|
236
236
|
"vitest": "^3.2.4"
|
|
237
237
|
},
|
|
238
238
|
"prettier": "@kazupon/prettier-config",
|