@bfra.me/eslint-config 0.50.1 → 0.50.3
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 +772 -226
- package/lib/index.js +11 -12
- package/package.json +26 -26
- package/src/configs/prettier.ts +2 -7
- package/src/rules.d.ts +772 -226
package/lib/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "./chunk-EGRHWZRV.js";
|
|
2
2
|
|
|
3
3
|
// src/define-config.ts
|
|
4
|
-
import { isPackageExists as
|
|
4
|
+
import { isPackageExists as isPackageExists3 } from "local-pkg";
|
|
5
5
|
|
|
6
6
|
// ../es/src/env/ci.ts
|
|
7
7
|
import isCI from "is-in-ci";
|
|
@@ -147,7 +147,7 @@ var GLOB_EXCLUDE = [
|
|
|
147
147
|
import { fileURLToPath } from "url";
|
|
148
148
|
|
|
149
149
|
// package.json
|
|
150
|
-
var version = "0.50.
|
|
150
|
+
var version = "0.50.3";
|
|
151
151
|
|
|
152
152
|
// src/parsers/any-parser.ts
|
|
153
153
|
var lineBreakPattern = /\r\n|[\n\r\u2028\u2029]/u;
|
|
@@ -1287,7 +1287,6 @@ async function pnpm() {
|
|
|
1287
1287
|
|
|
1288
1288
|
// src/configs/prettier.ts
|
|
1289
1289
|
import process4 from "process";
|
|
1290
|
-
import { isPackageExists as isPackageExists2 } from "local-pkg";
|
|
1291
1290
|
function getConfigRules(configs) {
|
|
1292
1291
|
if (Array.isArray(configs)) {
|
|
1293
1292
|
const configWithRules = [...configs].reverse().find(
|
|
@@ -1309,8 +1308,8 @@ async function prettier(options = {}) {
|
|
|
1309
1308
|
const [configPrettier, pluginPrettier, pluginJsonc, pluginYaml] = await Promise.all([
|
|
1310
1309
|
interopDefault(import("eslint-config-prettier")),
|
|
1311
1310
|
interopDefault(import("eslint-plugin-prettier")),
|
|
1312
|
-
|
|
1313
|
-
|
|
1311
|
+
interopDefault(import("eslint-plugin-jsonc")).catch(() => void 0),
|
|
1312
|
+
interopDefault(import("eslint-plugin-yml")).catch(() => void 0)
|
|
1314
1313
|
]);
|
|
1315
1314
|
const jsoncPrettierRules = getConfigRules(pluginJsonc?.configs.prettier);
|
|
1316
1315
|
const yamlPrettierRules = getConfigRules(pluginYaml?.configs.prettier);
|
|
@@ -1371,7 +1370,7 @@ async function prettier(options = {}) {
|
|
|
1371
1370
|
}
|
|
1372
1371
|
|
|
1373
1372
|
// src/configs/react.ts
|
|
1374
|
-
import { isPackageExists as
|
|
1373
|
+
import { isPackageExists as isPackageExists2 } from "local-pkg";
|
|
1375
1374
|
var ReactRefreshAllowConstantExportPackages = ["vite"];
|
|
1376
1375
|
var RemixPackages = ["@remix-run/node", "@remix-run/react", "@remix-run/serve", "@remix-run/dev"];
|
|
1377
1376
|
var ReactRouterPackages = [
|
|
@@ -1406,11 +1405,11 @@ async function react(options = {}) {
|
|
|
1406
1405
|
]);
|
|
1407
1406
|
const plugins = pluginReact.configs.all.plugins;
|
|
1408
1407
|
const isAllowConstantExport = ReactRefreshAllowConstantExportPackages.some(
|
|
1409
|
-
(i) =>
|
|
1408
|
+
(i) => isPackageExists2(i)
|
|
1410
1409
|
);
|
|
1411
|
-
const isUsingRemix = RemixPackages.some((i) =>
|
|
1412
|
-
const isUsingReactRouter = ReactRouterPackages.some((i) =>
|
|
1413
|
-
const isUsingNext = NextJsPackages.some((i) =>
|
|
1410
|
+
const isUsingRemix = RemixPackages.some((i) => isPackageExists2(i));
|
|
1411
|
+
const isUsingReactRouter = ReactRouterPackages.some((i) => isPackageExists2(i));
|
|
1412
|
+
const isUsingNext = NextJsPackages.some((i) => isPackageExists2(i));
|
|
1414
1413
|
return [
|
|
1415
1414
|
{
|
|
1416
1415
|
name: "@bfra.me/react/setup",
|
|
@@ -2306,10 +2305,10 @@ async function defineConfig(options = {}, ...userConfigs) {
|
|
|
2306
2305
|
packageJson: enablePackageJson = false,
|
|
2307
2306
|
perfectionist: enablePerfectionist = true,
|
|
2308
2307
|
pnpm: enableCatalogs = false,
|
|
2309
|
-
prettier: enablePrettier =
|
|
2308
|
+
prettier: enablePrettier = isPackageExists3("prettier"),
|
|
2310
2309
|
react: enableReact = false,
|
|
2311
2310
|
regexp: enableRegexp = true,
|
|
2312
|
-
typescript: enableTypeScript =
|
|
2311
|
+
typescript: enableTypeScript = isPackageExists3("typescript"),
|
|
2313
2312
|
unicorn: enableUnicorn = true
|
|
2314
2313
|
} = options;
|
|
2315
2314
|
let isInEditor = options.isInEditor;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bfra.me/eslint-config",
|
|
3
|
-
"version": "0.50.
|
|
3
|
+
"version": "0.50.3",
|
|
4
4
|
"description": "Shared ESLint configuration for bfra.me",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"bfra.me",
|
|
@@ -37,56 +37,56 @@
|
|
|
37
37
|
"src"
|
|
38
38
|
],
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@eslint-community/eslint-plugin-eslint-comments": "4.
|
|
41
|
-
"@eslint/markdown": "
|
|
42
|
-
"@stylistic/eslint-plugin": "5.
|
|
43
|
-
"eslint-config-flat-gitignore": "2.
|
|
44
|
-
"eslint-flat-config-utils": "3.0
|
|
40
|
+
"@eslint-community/eslint-plugin-eslint-comments": "4.7.1",
|
|
41
|
+
"@eslint/markdown": "8.0.1",
|
|
42
|
+
"@stylistic/eslint-plugin": "5.10.0",
|
|
43
|
+
"eslint-config-flat-gitignore": "2.3.0",
|
|
44
|
+
"eslint-flat-config-utils": "3.1.0",
|
|
45
45
|
"eslint-merge-processors": "2.0.0",
|
|
46
46
|
"eslint-plugin-command": "3.5.2",
|
|
47
|
-
"eslint-plugin-import-x": "4.16.
|
|
48
|
-
"eslint-plugin-jsdoc": "62.
|
|
47
|
+
"eslint-plugin-import-x": "4.16.2",
|
|
48
|
+
"eslint-plugin-jsdoc": "62.9.0",
|
|
49
49
|
"eslint-plugin-json-schema-validator": "6.2.0",
|
|
50
|
-
"eslint-plugin-jsonc": "3.1.
|
|
50
|
+
"eslint-plugin-jsonc": "3.1.2",
|
|
51
51
|
"eslint-plugin-n": "17.24.0",
|
|
52
|
-
"eslint-plugin-perfectionist": "5.
|
|
53
|
-
"eslint-plugin-regexp": "3.
|
|
54
|
-
"eslint-plugin-toml": "1.3.
|
|
55
|
-
"eslint-plugin-unicorn": "
|
|
52
|
+
"eslint-plugin-perfectionist": "5.8.0",
|
|
53
|
+
"eslint-plugin-regexp": "3.1.0",
|
|
54
|
+
"eslint-plugin-toml": "1.3.1",
|
|
55
|
+
"eslint-plugin-unicorn": "64.0.0",
|
|
56
56
|
"eslint-plugin-unused-imports": "4.4.1",
|
|
57
|
-
"eslint-plugin-yml": "3.3.
|
|
58
|
-
"globals": "17.
|
|
57
|
+
"eslint-plugin-yml": "3.3.1",
|
|
58
|
+
"globals": "17.4.0",
|
|
59
59
|
"is-in-ci": "2.0.0",
|
|
60
60
|
"local-pkg": "1.1.2",
|
|
61
61
|
"package-manager-detector": "1.6.0",
|
|
62
62
|
"sort-package-json": "3.6.1",
|
|
63
|
-
"typescript-eslint": "8.
|
|
63
|
+
"typescript-eslint": "8.58.0",
|
|
64
64
|
"@bfra.me/es": "0.1.0"
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|
|
67
67
|
"@eslint-react/eslint-plugin": "2.13.0",
|
|
68
|
-
"@eslint/config-inspector": "1.
|
|
69
|
-
"@eslint/core": "1.
|
|
70
|
-
"@next/eslint-plugin-next": "16.
|
|
68
|
+
"@eslint/config-inspector": "1.5.0",
|
|
69
|
+
"@eslint/core": "1.2.0",
|
|
70
|
+
"@next/eslint-plugin-next": "16.2.2",
|
|
71
71
|
"@types/eslint-config-prettier": "6.11.3",
|
|
72
72
|
"@types/eslint-plugin-jsx-a11y": "6.10.1",
|
|
73
|
-
"@typescript-eslint/types": "8.
|
|
74
|
-
"@vitest/eslint-plugin": "1.6.
|
|
75
|
-
"astro-eslint-parser": "1.
|
|
76
|
-
"eslint": "10.0
|
|
73
|
+
"@typescript-eslint/types": "8.58.0",
|
|
74
|
+
"@vitest/eslint-plugin": "1.6.14",
|
|
75
|
+
"astro-eslint-parser": "1.4.0",
|
|
76
|
+
"eslint": "10.2.0",
|
|
77
77
|
"eslint-config-prettier": "10.1.8",
|
|
78
78
|
"eslint-plugin-astro": "1.6.0",
|
|
79
79
|
"eslint-plugin-erasable-syntax-only": "0.4.0",
|
|
80
80
|
"eslint-plugin-jsx-a11y": "6.10.2",
|
|
81
|
-
"eslint-plugin-node-dependencies": "2.
|
|
81
|
+
"eslint-plugin-node-dependencies": "2.2.0",
|
|
82
82
|
"eslint-plugin-pnpm": "1.6.0",
|
|
83
83
|
"eslint-plugin-prettier": "5.5.5",
|
|
84
84
|
"eslint-plugin-react-hooks": "7.0.1",
|
|
85
85
|
"eslint-plugin-react-refresh": "0.5.2",
|
|
86
86
|
"eslint-typegen": "2.3.1",
|
|
87
|
-
"@bfra.me/
|
|
87
|
+
"@bfra.me/works": "0.0.0-development",
|
|
88
88
|
"@bfra.me/tsconfig": "0.12.2",
|
|
89
|
-
"@bfra.me/
|
|
89
|
+
"@bfra.me/prettier-config": "0.16.7"
|
|
90
90
|
},
|
|
91
91
|
"peerDependencies": {
|
|
92
92
|
"@eslint-react/eslint-plugin": "^2.2.3",
|
package/src/configs/prettier.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type {Config} from '../config'
|
|
2
2
|
import type {Flatten, OptionsIsInEditor, OptionsOverrides} from '../options'
|
|
3
3
|
import process from 'node:process'
|
|
4
|
-
import {isPackageExists} from 'local-pkg'
|
|
5
4
|
import {GLOB_EXT_IN_MARKDOWN_FILES, GLOB_MARKDOWN_FILES, GLOB_TOML_FILES} from '../globs'
|
|
6
5
|
import {requireOf} from '../require-of'
|
|
7
6
|
import {interopDefault} from '../utils'
|
|
@@ -46,12 +45,8 @@ export async function prettier(options: PrettierOptions = {}): Promise<Config[]>
|
|
|
46
45
|
const [configPrettier, pluginPrettier, pluginJsonc, pluginYaml] = await Promise.all([
|
|
47
46
|
interopDefault(import('eslint-config-prettier')),
|
|
48
47
|
interopDefault(import('eslint-plugin-prettier')),
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
: Promise.resolve(undefined),
|
|
52
|
-
isPackageExists('eslint-plugin-yml')
|
|
53
|
-
? interopDefault(import('eslint-plugin-yml'))
|
|
54
|
-
: Promise.resolve(undefined),
|
|
48
|
+
interopDefault(import('eslint-plugin-jsonc')).catch(() => undefined),
|
|
49
|
+
interopDefault(import('eslint-plugin-yml')).catch(() => undefined),
|
|
55
50
|
])
|
|
56
51
|
const jsoncPrettierRules = getConfigRules(pluginJsonc?.configs.prettier)
|
|
57
52
|
const yamlPrettierRules = getConfigRules(pluginYaml?.configs.prettier)
|