@vida0905/eslint-config 0.2.0 → 0.3.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 CHANGED
@@ -8,7 +8,7 @@ Self use eslint config, extends [antfu's config](https://github.com/antfu/eslint
8
8
 
9
9
  - More stricter rules.
10
10
  - Support `pinia`.
11
- - Disable `formatter` and `jsx`
11
+ - Disable `jsx` by default.
12
12
 
13
13
  ### Setup
14
14
 
@@ -19,9 +19,9 @@ npm i -D @vida/eslint-config
19
19
  in `eslint.config.js`
20
20
 
21
21
  ```js
22
- import { vida } from '@vida0905/eslint-config';
22
+ import { vida } from '@vida0905/eslint-config'
23
23
 
24
- export default vida();
24
+ export default vida()
25
25
  ```
26
26
 
27
27
  in `.vscode/settings.json`, more info to [@antfu/eslint-config](https://github.com/antfu/eslint-config?tab=readme-ov-file#vs-code-support-auto-fix-on-save)
package/dist/index.d.ts CHANGED
@@ -13,6 +13,6 @@ type OptionsConfig = AntfuOptions & {
13
13
  pinia?: boolean;
14
14
  };
15
15
 
16
- declare function vida(options?: OptionsConfig, ...userConfigs: TypedFlatConfigItem[]): eslint_flat_config_utils.FlatConfigComposer<TypedFlatConfigItem, _antfu_eslint_config.ConfigNames>;
16
+ declare function vida(options?: OptionsConfig & TypedFlatConfigItem, ...userConfigs: TypedFlatConfigItem[]): eslint_flat_config_utils.FlatConfigComposer<TypedFlatConfigItem, _antfu_eslint_config.ConfigNames>;
17
17
 
18
18
  export { vida as default, vida };
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@vida0905/eslint-config",
3
3
  "type": "module",
4
- "version": "0.2.0",
5
- "packageManager": "pnpm@9.1.2",
4
+ "version": "0.3.0",
5
+ "packageManager": "pnpm@9.4.0",
6
6
  "description": "Vida Xie's ESLint Config",
7
7
  "author": "Vida Xie <vida_2020@163.com> (https://github.com/9romise/)",
8
8
  "license": "MIT",
@@ -36,18 +36,40 @@
36
36
  "build": "tsup",
37
37
  "release": "npm run lint && npm run typecheck && bumpp",
38
38
  "typecheck": "tsc --noEmit",
39
- "prepublish": "npm run build"
39
+ "prepack": "npm run build",
40
+ "prepare": "simple-git-hooks"
41
+ },
42
+ "peerDependencies": {
43
+ "@unocss/eslint-plugin": ">=0.50.0",
44
+ "eslint": ">=8.40.0",
45
+ "eslint-plugin-format": ">=0.1.0"
46
+ },
47
+ "peerDependenciesMeta": {
48
+ "@unocss/eslint-plugin": {
49
+ "optional": true
50
+ },
51
+ "eslint-plugin-format": {
52
+ "optional": true
53
+ }
40
54
  },
41
55
  "dependencies": {
42
- "@antfu/eslint-config": "^2.18.1",
56
+ "@antfu/eslint-config": "^2.21.1",
43
57
  "eslint-plugin-pinia": "^0.1.13",
44
58
  "local-pkg": "^0.5.0"
45
59
  },
46
60
  "devDependencies": {
47
- "@eslint/config-inspector": "^0.4.8",
61
+ "@eslint/config-inspector": "^0.5.0",
48
62
  "bumpp": "^9.4.1",
49
- "eslint": "^9.3.0",
50
- "tsup": "^8.0.2",
51
- "typescript": "^5.4.5"
63
+ "eslint": "^9.5.0",
64
+ "lint-staged": "^15.2.7",
65
+ "simple-git-hooks": "^2.11.1",
66
+ "tsup": "^8.1.0",
67
+ "typescript": "^5.5.2"
68
+ },
69
+ "simple-git-hooks": {
70
+ "pre-commit": "npx lint-staged"
71
+ },
72
+ "lint-staged": {
73
+ "*": "eslint --fix"
52
74
  }
53
75
  }
package/dist/index.cjs DELETED
@@ -1,121 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
21
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
22
- // If the importer is in node compatibility mode or this is not an ESM
23
- // file that has been converted to a CommonJS file using a Babel-
24
- // compatible transform (i.e. "__esModule" has not been set), then set
25
- // "default" to the CommonJS "module.exports" for node compatibility.
26
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
27
- mod
28
- ));
29
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
30
-
31
- // src/index.ts
32
- var src_exports = {};
33
- __export(src_exports, {
34
- default: () => src_default,
35
- vida: () => vida
36
- });
37
- module.exports = __toCommonJS(src_exports);
38
- var import_eslint_config2 = __toESM(require("@antfu/eslint-config"), 1);
39
- var import_local_pkg = require("local-pkg");
40
-
41
- // src/configs/pinia.ts
42
- var import_eslint_config = require("@antfu/eslint-config");
43
- var import_eslint_plugin_pinia = __toESM(require("eslint-plugin-pinia"), 1);
44
- var GLOB_PINIA_JS = `stores/${import_eslint_config.GLOB_JS}`;
45
- var GLOB_PINIA_TS = `stores/${import_eslint_config.GLOB_TS}`;
46
- var pinia = [
47
- {
48
- name: "vida/pinia",
49
- files: [GLOB_PINIA_JS, GLOB_PINIA_TS],
50
- plugins: {
51
- pinia: import_eslint_plugin_pinia.default
52
- },
53
- rules: {
54
- "pinia/prefer-single-store-per-file": ["error"],
55
- "pinia/prefer-use-store-naming-convention": ["error", {
56
- checkStoreNameMismatch: true,
57
- storeSuffix: "Store"
58
- }],
59
- "pinia/require-setup-store-properties-export": ["warn"],
60
- "pinia/no-duplicate-store-ids": ["error"]
61
- }
62
- }
63
- ];
64
-
65
- // src/overrides/javascript.ts
66
- var javascript = {
67
- "arrow-body-style": ["error", "as-needed"],
68
- "no-unused-private-class-members": "error",
69
- "require-atomic-updates": ["error", { allowProperties: true }]
70
- };
71
-
72
- // src/overrides/vue.ts
73
- var vue = {
74
- "vue/max-attributes-per-line": ["error", {
75
- singleline: 5,
76
- multiline: 1
77
- }]
78
- };
79
-
80
- // src/index.ts
81
- __reExport(src_exports, require("@antfu/eslint-config"), module.exports);
82
- function vida(options = {}, ...userConfigs) {
83
- const {
84
- pinia: enablePinia = (0, import_local_pkg.isPackageExists)("pinia")
85
- } = options;
86
- const configs = [];
87
- if (enablePinia)
88
- configs.push(pinia);
89
- const antfuConfig = {
90
- stylistic: {
91
- indent: 2,
92
- quotes: "single",
93
- semi: false,
94
- overrides: {
95
- "style/arrow-parens": ["error", "always"],
96
- "style/brace-style": ["error", "1tbs", { allowSingleLine: true }]
97
- }
98
- },
99
- javascript: {
100
- overrides: javascript
101
- },
102
- vue: {
103
- overrides: vue
104
- },
105
- jsx: false
106
- };
107
- return (0, import_eslint_config2.default)(
108
- {
109
- ...antfuConfig,
110
- ...options
111
- },
112
- ...configs,
113
- ...userConfigs
114
- );
115
- }
116
- var src_default = vida;
117
- // Annotate the CommonJS export names for ESM import in node:
118
- 0 && (module.exports = {
119
- vida,
120
- ...require("@antfu/eslint-config")
121
- });
package/dist/index.d.cts DELETED
@@ -1,18 +0,0 @@
1
- import * as eslint_flat_config_utils from 'eslint-flat-config-utils';
2
- import * as _antfu_eslint_config from '@antfu/eslint-config';
3
- import { antfu, TypedFlatConfigItem } from '@antfu/eslint-config';
4
- export * from '@antfu/eslint-config';
5
-
6
- type AntfuOptions = Parameters<typeof antfu>[0];
7
- type OptionsConfig = AntfuOptions & {
8
- /**
9
- * Enable Pinia support.
10
- *
11
- * @default auto-detect based on the dependencies
12
- */
13
- pinia?: boolean;
14
- };
15
-
16
- declare function vida(options?: OptionsConfig, ...userConfigs: TypedFlatConfigItem[]): eslint_flat_config_utils.FlatConfigComposer<TypedFlatConfigItem, _antfu_eslint_config.ConfigNames>;
17
-
18
- export { vida as default, vida };