@bfra.me/eslint-config 0.39.0 → 0.40.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/lib/index.d.ts +4 -0
- package/lib/index.js +8 -6
- package/lib/{missing-module-for-config-DNGJUDHU.js → missing-module-for-config-QFYTX2KG.js} +3 -3
- package/package.json +8 -11
- package/src/configs/eslint-comments.ts +3 -2
- package/src/configs/imports.ts +3 -3
- package/src/plugins.ts +3 -0
- package/src/rules/missing-module-for-config.ts +2 -3
- package/src/rules.d.ts +4 -0
- package/src/plugins.d.ts +0 -29
package/lib/index.d.ts
CHANGED
|
@@ -10524,6 +10524,10 @@ type JsdocSortTags = []|[{
|
|
|
10524
10524
|
|
|
10525
10525
|
reportTagGroupSpacing?: boolean
|
|
10526
10526
|
|
|
10527
|
+
tagExceptions?: {
|
|
10528
|
+
[k: string]: number
|
|
10529
|
+
}
|
|
10530
|
+
|
|
10527
10531
|
tagSequence?: {
|
|
10528
10532
|
|
|
10529
10533
|
tags?: string[]
|
package/lib/index.js
CHANGED
|
@@ -105,7 +105,7 @@ var GLOB_EXCLUDE = [
|
|
|
105
105
|
import { fileURLToPath } from "url";
|
|
106
106
|
|
|
107
107
|
// package.json
|
|
108
|
-
var version = "0.
|
|
108
|
+
var version = "0.40.0";
|
|
109
109
|
|
|
110
110
|
// src/parsers/any-parser.ts
|
|
111
111
|
var lineBreakPattern = /\r\n|[\n\r\u2028\u2029]/u;
|
|
@@ -164,7 +164,7 @@ async function interopDefault(m) {
|
|
|
164
164
|
|
|
165
165
|
// src/configs/fallback.ts
|
|
166
166
|
async function fallback(missingList = [], options) {
|
|
167
|
-
const rules = await interopDefault(import("./missing-module-for-config-
|
|
167
|
+
const rules = await interopDefault(import("./missing-module-for-config-QFYTX2KG.js"));
|
|
168
168
|
const pluginName = `@bfra.me${missingList.length > 0 ? `/missing-modules-${missingList.map((m) => m.replaceAll(/[^a-z0-9]/gi, "-").toLowerCase()).join("-")}` : ""}`;
|
|
169
169
|
return [
|
|
170
170
|
{
|
|
@@ -311,13 +311,16 @@ async function epilogue() {
|
|
|
311
311
|
];
|
|
312
312
|
}
|
|
313
313
|
|
|
314
|
+
// src/plugins.ts
|
|
315
|
+
import { default as default2 } from "@eslint-community/eslint-plugin-eslint-comments";
|
|
316
|
+
import { default as default3 } from "eslint-plugin-import-x";
|
|
317
|
+
|
|
314
318
|
// src/configs/eslint-comments.ts
|
|
315
|
-
import pluginEslintComments from "@eslint-community/eslint-plugin-eslint-comments";
|
|
316
319
|
function eslintComments() {
|
|
317
320
|
return [
|
|
318
321
|
{
|
|
319
322
|
name: "@bfra.me/eslint-comments/rules",
|
|
320
|
-
plugins: { "eslint-comments":
|
|
323
|
+
plugins: { "eslint-comments": default2 },
|
|
321
324
|
rules: {
|
|
322
325
|
"eslint-comments/disable-enable-pair": ["error", { allowWholeFile: true }],
|
|
323
326
|
"eslint-comments/no-aggregating-enable": "error",
|
|
@@ -355,12 +358,11 @@ async function imports(options = {}) {
|
|
|
355
358
|
return requireOf(
|
|
356
359
|
["eslint-plugin-import-x"],
|
|
357
360
|
async () => {
|
|
358
|
-
const pluginImportX = await interopDefault(import("eslint-plugin-import-x"));
|
|
359
361
|
return [
|
|
360
362
|
{
|
|
361
363
|
name: "@bfra.me/imports",
|
|
362
364
|
plugins: {
|
|
363
|
-
"import-x":
|
|
365
|
+
"import-x": default3
|
|
364
366
|
},
|
|
365
367
|
rules: {
|
|
366
368
|
"import-x/no-named-default": "error",
|
|
@@ -126,11 +126,11 @@ function create(context) {
|
|
|
126
126
|
for (const module of modules) {
|
|
127
127
|
let output = "";
|
|
128
128
|
if (shouldFix) {
|
|
129
|
-
const result = tryInstall(module, context.filename
|
|
129
|
+
const result = tryInstall(module, context.filename) ?? "";
|
|
130
130
|
output = result ? `
|
|
131
131
|
${result}` : "";
|
|
132
132
|
}
|
|
133
|
-
const command = getPackageInstallCommand(module, context.filename
|
|
133
|
+
const command = getPackageInstallCommand(module, context.filename) ?? "";
|
|
134
134
|
context.report({
|
|
135
135
|
loc: { column: 0, line: 1 },
|
|
136
136
|
message: `Missing module for config: ${module}. Run: \`${command || `npm i -D ${module}`}\`${output}`
|
|
@@ -142,4 +142,4 @@ export {
|
|
|
142
142
|
create,
|
|
143
143
|
meta
|
|
144
144
|
};
|
|
145
|
-
//# sourceMappingURL=missing-module-for-config-
|
|
145
|
+
//# sourceMappingURL=missing-module-for-config-QFYTX2KG.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bfra.me/eslint-config",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.40.0",
|
|
4
4
|
"description": "Shared ESLint configuration for bfra.me",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"bfra.me",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"eslint-merge-processors": "2.0.0",
|
|
46
46
|
"eslint-plugin-command": "3.3.1",
|
|
47
47
|
"eslint-plugin-import-x": "4.16.1",
|
|
48
|
-
"eslint-plugin-jsdoc": "61.1
|
|
48
|
+
"eslint-plugin-jsdoc": "61.2.1",
|
|
49
49
|
"eslint-plugin-json-schema-validator": "5.5.0",
|
|
50
50
|
"eslint-plugin-jsonc": "2.21.0",
|
|
51
51
|
"eslint-plugin-n": "17.23.1",
|
|
@@ -64,10 +64,10 @@
|
|
|
64
64
|
"typescript-eslint": "8.46.4"
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|
|
67
|
-
"@eslint-react/eslint-plugin": "2.3.
|
|
67
|
+
"@eslint-react/eslint-plugin": "2.3.5",
|
|
68
68
|
"@eslint/config-inspector": "1.3.0",
|
|
69
|
-
"@eslint/core": "0.
|
|
70
|
-
"@next/eslint-plugin-next": "16.0.
|
|
69
|
+
"@eslint/core": "1.0.0",
|
|
70
|
+
"@next/eslint-plugin-next": "16.0.3",
|
|
71
71
|
"@types/eslint-config-prettier": "6.11.3",
|
|
72
72
|
"@typescript-eslint/types": "8.46.4",
|
|
73
73
|
"@vitest/eslint-plugin": "1.4.2",
|
|
@@ -82,11 +82,8 @@
|
|
|
82
82
|
"eslint-plugin-react-hooks": "7.0.1",
|
|
83
83
|
"eslint-plugin-react-refresh": "0.4.24",
|
|
84
84
|
"eslint-typegen": "2.3.0",
|
|
85
|
-
"
|
|
86
|
-
"
|
|
87
|
-
"@bfra.me/eslint-config": "0.39.0",
|
|
88
|
-
"@bfra.me/prettier-config": "0.16.1",
|
|
89
|
-
"@bfra.me/tsconfig": "0.12.0"
|
|
85
|
+
"@bfra.me/prettier-config": "0.16.3",
|
|
86
|
+
"@bfra.me/works": "0.0.0-development"
|
|
90
87
|
},
|
|
91
88
|
"peerDependencies": {
|
|
92
89
|
"@eslint-react/eslint-plugin": "^2.0.1",
|
|
@@ -138,6 +135,6 @@
|
|
|
138
135
|
"build-inspector": "eslint-config-inspector build --config ./eslint.config.ts",
|
|
139
136
|
"dev": "eslint-config-inspector --config ./eslint.config.ts --open false",
|
|
140
137
|
"generate-types": "tsx ./scripts/generate-types.ts",
|
|
141
|
-
"test": "
|
|
138
|
+
"test": "vitest run"
|
|
142
139
|
}
|
|
143
140
|
}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
+
import type {Plugin} from '@eslint/core'
|
|
1
2
|
import type {Config} from '../config'
|
|
2
|
-
import pluginEslintComments from '
|
|
3
|
+
import {pluginEslintComments} from '../plugins'
|
|
3
4
|
|
|
4
5
|
export function eslintComments(): Config[] {
|
|
5
6
|
return [
|
|
6
7
|
{
|
|
7
8
|
name: '@bfra.me/eslint-comments/rules',
|
|
8
|
-
plugins: {'eslint-comments': pluginEslintComments},
|
|
9
|
+
plugins: {'eslint-comments': pluginEslintComments as Plugin},
|
|
9
10
|
rules: {
|
|
10
11
|
'eslint-comments/disable-enable-pair': ['error', {allowWholeFile: true}],
|
|
11
12
|
'eslint-comments/no-aggregating-enable': 'error',
|
package/src/configs/imports.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import type {Plugin} from '@eslint/core'
|
|
1
2
|
import type {Config} from '../config'
|
|
2
3
|
import type {Flatten, OptionsOverrides, OptionsStylistic} from '../options'
|
|
4
|
+
import {pluginImportX} from '../plugins'
|
|
3
5
|
import {requireOf} from '../require-of'
|
|
4
|
-
import {interopDefault} from '../utils'
|
|
5
6
|
import {fallback} from './fallback'
|
|
6
7
|
|
|
7
8
|
/**
|
|
@@ -41,12 +42,11 @@ export async function imports(options: ImportsOptions = {}): Promise<Config[]> {
|
|
|
41
42
|
return requireOf(
|
|
42
43
|
['eslint-plugin-import-x'],
|
|
43
44
|
async () => {
|
|
44
|
-
const pluginImportX = await interopDefault(import('eslint-plugin-import-x'))
|
|
45
45
|
return [
|
|
46
46
|
{
|
|
47
47
|
name: '@bfra.me/imports',
|
|
48
48
|
plugins: {
|
|
49
|
-
'import-x': pluginImportX,
|
|
49
|
+
'import-x': pluginImportX as unknown as Plugin,
|
|
50
50
|
},
|
|
51
51
|
rules: {
|
|
52
52
|
'import-x/no-named-default': 'error',
|
package/src/plugins.ts
ADDED
|
@@ -40,11 +40,10 @@ export function create(context: RuleContext) {
|
|
|
40
40
|
for (const module of modules) {
|
|
41
41
|
let output = ''
|
|
42
42
|
if (shouldFix) {
|
|
43
|
-
const result = tryInstall(module, context.filename
|
|
43
|
+
const result = tryInstall(module, context.filename) ?? ''
|
|
44
44
|
output = result ? `\n${result}` : ''
|
|
45
45
|
}
|
|
46
|
-
const command =
|
|
47
|
-
getPackageInstallCommand(module, context.filename || context.getFilename()) ?? ''
|
|
46
|
+
const command = getPackageInstallCommand(module, context.filename) ?? ''
|
|
48
47
|
context.report({
|
|
49
48
|
loc: {column: 0, line: 1},
|
|
50
49
|
message: `Missing module for config: ${module}. Run: \`${command || `npm i -D ${module}`}\`${output}`,
|
package/src/rules.d.ts
CHANGED
|
@@ -10515,6 +10515,10 @@ type JsdocSortTags = []|[{
|
|
|
10515
10515
|
|
|
10516
10516
|
reportTagGroupSpacing?: boolean
|
|
10517
10517
|
|
|
10518
|
+
tagExceptions?: {
|
|
10519
|
+
[k: string]: number
|
|
10520
|
+
}
|
|
10521
|
+
|
|
10518
10522
|
tagSequence?: {
|
|
10519
10523
|
|
|
10520
10524
|
tags?: string[]
|
package/src/plugins.d.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
declare module '@eslint-community/eslint-plugin-eslint-comments' {
|
|
2
|
-
import type {ConfigObject, Plugin, RulesConfig} from '@eslint/core'
|
|
3
|
-
|
|
4
|
-
const plugin: Plugin & {
|
|
5
|
-
configs: {
|
|
6
|
-
recommended: ConfigObject & {
|
|
7
|
-
rules: RulesConfig
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export default plugin
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
declare module 'eslint-plugin-import-x' {
|
|
16
|
-
import type {Plugin} from '@eslint/core'
|
|
17
|
-
|
|
18
|
-
const plugin: Plugin
|
|
19
|
-
|
|
20
|
-
export default plugin
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
declare module 'eslint-plugin-perfectionist' {
|
|
24
|
-
import type {Plugin} from '@eslint/core'
|
|
25
|
-
|
|
26
|
-
const plugin: Plugin
|
|
27
|
-
|
|
28
|
-
export default plugin
|
|
29
|
-
}
|