@lincy/eslint-config 3.0.5 → 3.0.7

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.
@@ -0,0 +1,149 @@
1
+ import { FlatESLintConfigItem } from 'eslint-define-config';
2
+ export { default as pluginAntfu } from 'eslint-plugin-antfu';
3
+ export { default as pluginComments } from 'eslint-plugin-eslint-comments';
4
+ export { default as pluginImport } from 'eslint-plugin-i';
5
+ export { default as pluginJsdoc } from 'eslint-plugin-jsdoc';
6
+ export { default as pluginJsonc } from 'eslint-plugin-jsonc';
7
+ export { default as pluginMarkdown } from 'eslint-plugin-markdown';
8
+ export { default as pluginNode } from 'eslint-plugin-n';
9
+ export { default as pluginStylisticJs } from '@stylistic/eslint-plugin-js';
10
+ export { default as pluginStylisticTs } from '@stylistic/eslint-plugin-ts';
11
+ export { default as pluginTs } from '@typescript-eslint/eslint-plugin';
12
+ export { default as pluginUnicorn } from 'eslint-plugin-unicorn';
13
+ export { default as pluginUnusedImports } from 'eslint-plugin-unused-imports';
14
+ export { default as pluginVue } from 'eslint-plugin-vue';
15
+ export { default as pluginYml } from 'eslint-plugin-yml';
16
+ export { default as pluginNoOnlyTests } from 'eslint-plugin-no-only-tests';
17
+ export { default as parserTs } from '@typescript-eslint/parser';
18
+ export { default as parserVue } from 'vue-eslint-parser';
19
+ export { default as parserYml } from 'yaml-eslint-parser';
20
+ export { default as parserJsonc } from 'jsonc-eslint-parser';
21
+
22
+ interface OptionsComponentExts {
23
+ /**
24
+ * Additional extensions for components.
25
+ *
26
+ * @example ['vue']
27
+ * @default []
28
+ */
29
+ componentExts?: string[];
30
+ }
31
+ interface OptionsTypeScriptWithLanguageServer {
32
+ tsconfigPath: string;
33
+ tsconfigRootDir?: string;
34
+ }
35
+ interface OptionsHasTypeScript {
36
+ typescript?: boolean;
37
+ }
38
+ interface OptionsIsInEditor {
39
+ isInEditor?: boolean;
40
+ }
41
+ interface OptionsConfig {
42
+ /**
43
+ * Enable TypeScript support.
44
+ *
45
+ * Passing an object to enable TypeScript Language Server support.
46
+ *
47
+ * @default auto-detect based on the dependencies
48
+ */
49
+ typescript?: boolean | OptionsTypeScriptWithLanguageServer;
50
+ /**
51
+ * Enable test support.
52
+ *
53
+ * @default true
54
+ */
55
+ test?: boolean;
56
+ /**
57
+ * Enable Vue support.
58
+ *
59
+ * @default auto-detect based on the dependencies
60
+ */
61
+ vue?: boolean;
62
+ /**
63
+ * Enable JSONC support.
64
+ *
65
+ * @default true
66
+ */
67
+ jsonc?: boolean;
68
+ /**
69
+ * Enable YAML support.
70
+ *
71
+ * @default true
72
+ */
73
+ yaml?: boolean;
74
+ /**
75
+ * Enable Markdown support.
76
+ *
77
+ * @default true
78
+ */
79
+ markdown?: boolean;
80
+ /**
81
+ * Enable stylistic rules.
82
+ *
83
+ * @default true
84
+ */
85
+ stylistic?: boolean;
86
+ /**
87
+ * Control to disable some rules in editors.
88
+ * @default auto-detect based on the process.env
89
+ */
90
+ isInEditor?: boolean;
91
+ }
92
+
93
+ /**
94
+ * Construct an array of ESLint flat config items.
95
+ */
96
+ declare function factoryFunc(options?: OptionsConfig, ...userConfigs: (FlatESLintConfigItem | FlatESLintConfigItem[])[]): FlatESLintConfigItem[];
97
+
98
+ declare const comments: FlatESLintConfigItem[];
99
+
100
+ declare const ignores: FlatESLintConfigItem[];
101
+
102
+ declare const imports: FlatESLintConfigItem[];
103
+
104
+ declare function javascript(options?: OptionsIsInEditor): FlatESLintConfigItem[];
105
+
106
+ declare const jsdoc: FlatESLintConfigItem[];
107
+
108
+ declare const jsonc: FlatESLintConfigItem[];
109
+
110
+ declare function markdown(options?: OptionsComponentExts): FlatESLintConfigItem[];
111
+
112
+ declare const node: FlatESLintConfigItem[];
113
+
114
+ /**
115
+ * Sort package.json
116
+ *
117
+ * Requires `jsonc` config
118
+ */
119
+ declare const sortPackageJson: FlatESLintConfigItem[];
120
+ /**
121
+ * Sort tsconfig.json
122
+ *
123
+ * Requires `jsonc` config
124
+ */
125
+ declare const sortTsconfig: FlatESLintConfigItem[];
126
+
127
+ declare const javascriptStylistic: FlatESLintConfigItem[];
128
+ declare const typescriptStylistic: FlatESLintConfigItem[];
129
+
130
+ declare function typescript(options?: OptionsComponentExts): FlatESLintConfigItem[];
131
+ declare function typescriptWithLanguageServer(options: OptionsTypeScriptWithLanguageServer & OptionsComponentExts): FlatESLintConfigItem[];
132
+
133
+ declare const unicorn: FlatESLintConfigItem[];
134
+
135
+ declare function vue(options?: OptionsHasTypeScript): FlatESLintConfigItem[];
136
+
137
+ declare const yml: FlatESLintConfigItem[];
138
+
139
+ declare function test(options?: OptionsIsInEditor): FlatESLintConfigItem[];
140
+
141
+ /**
142
+ * Combine array and non-array configs into a single array.
143
+ */
144
+ declare function combine(...configs: (FlatESLintConfigItem | FlatESLintConfigItem[])[]): FlatESLintConfigItem[];
145
+ declare function renameRules(rules: Record<string, any>, from: string, to: string): {
146
+ [k: string]: any;
147
+ };
148
+
149
+ export { OptionsComponentExts, OptionsConfig, OptionsHasTypeScript, OptionsIsInEditor, OptionsTypeScriptWithLanguageServer, combine, comments, factoryFunc as default, factoryFunc, ignores, imports, javascript, javascriptStylistic, jsdoc, jsonc, markdown, node, renameRules, sortPackageJson, sortTsconfig, test, typescript, typescriptStylistic, typescriptWithLanguageServer, unicorn, vue, yml };
package/dist/index.js CHANGED
@@ -1147,6 +1147,15 @@ function vue(options = {}) {
1147
1147
  "vue/html-comment-content-spacing": ["error", "always", {
1148
1148
  exceptions: ["-"]
1149
1149
  }],
1150
+ "vue/html-self-closing": ["error", {
1151
+ html: {
1152
+ void: "never",
1153
+ normal: "any",
1154
+ component: "any"
1155
+ },
1156
+ svg: "always",
1157
+ math: "always"
1158
+ }],
1150
1159
  "vue/key-spacing": ["error", { afterColon: true, beforeColon: false }],
1151
1160
  "vue/keyword-spacing": ["error", { after: true, before: true }],
1152
1161
  "vue/max-attributes-per-line": OFF,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@lincy/eslint-config",
3
3
  "type": "module",
4
- "version": "3.0.5",
4
+ "version": "3.0.7",
5
5
  "packageManager": "pnpm@8.7.6",
6
6
  "description": "LinCenYing's ESLint config",
7
7
  "author": "LinCenYing <lincenying@gmail.com> (https://github.com/lincenying/)",
@@ -10,20 +10,29 @@
10
10
  "keywords": [
11
11
  "eslint-config"
12
12
  ],
13
- "main": "dist/index.js",
13
+ "main": "dist/index.cjs",
14
+ "module": "dist/index.js",
15
+ "types": "dist/index.d.ts",
16
+ "exports": {
17
+ ".": {
18
+ "types": "dist/index.d.ts",
19
+ "require": "dist/index.cjs",
20
+ "import": "dist/index.js"
21
+ }
22
+ },
14
23
  "files": [
15
24
  "dist"
16
25
  ],
17
26
  "scripts": {
18
- "build": "tsup src/index.ts --format esm --clean --dts",
19
- "stub": "tsup src/index.ts --format esm --clean",
27
+ "build": "tsup src/index.ts --format esm,cjs --shims --clean --dts",
28
+ "stub": "tsup src/index.ts --format esm,cjs --shims --clean",
20
29
  "lint": "pnpm run stub && eslint .",
21
30
  "postpublish": "open https://npmmirror.com/package/@lincy/eslint-config",
22
31
  "prepublishOnly": "nr build",
23
32
  "release": "bumpp && npm publish -r --access public",
24
33
  "test": "vitest",
25
34
  "typecheck": "tsc --noEmit",
26
- "prepare": "simple-git-hooks"
35
+ "prepare": "sh simple-git-hooks.sh"
27
36
  },
28
37
  "peerDependencies": {
29
38
  "eslint": ">=8.0.0"
@@ -36,7 +45,7 @@
36
45
  "@typescript-eslint/eslint-plugin": "^6.7.2",
37
46
  "@typescript-eslint/parser": "^6.7.2",
38
47
  "eslint-define-config": "^1.23.0",
39
- "eslint-plugin-antfu": "^1.0.0-beta.2",
48
+ "eslint-plugin-antfu": "1.0.0-beta.3",
40
49
  "eslint-plugin-eslint-comments": "^3.2.0",
41
50
  "eslint-plugin-i": "^2.28.1",
42
51
  "eslint-plugin-jsdoc": "^46.8.2",
@@ -80,10 +89,10 @@
80
89
  }
81
90
  },
82
91
  "simple-git-hooks": {
83
- "pre-commit": "pnpm lint-staged"
92
+ "pre-commit": "npx lint-staged"
84
93
  },
85
94
  "lint-staged": {
86
- "*.{ts,tsx,vue}": "eslint --fix"
95
+ "*.{[jt]s?(x),vue,md}": "eslint --fix"
87
96
  },
88
97
  "publishConfig": {
89
98
  "registry": "https://registry.npmjs.org/"