@daopk/eslint-config 0.0.3 → 0.0.4

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.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { StylisticCustomizeOptions } from '@stylistic/eslint-plugin';
1
2
  import { Linter } from 'eslint';
2
3
 
3
4
  /* eslint-disable */
@@ -8608,7 +8609,8 @@ type Yoda = []|[("always" | "never")]|[("always" | "never"), {
8608
8609
  onlyEquality?: boolean
8609
8610
  }]
8610
8611
 
8611
- interface Options {
8612
+ type StylisticOptions = Omit<StylisticCustomizeOptions, 'flat' | 'pluginName'>;
8613
+ interface Options extends StylisticOptions {
8612
8614
  ignores?: string[];
8613
8615
  rules?: RuleOptions;
8614
8616
  }
package/dist/index.js CHANGED
@@ -9,6 +9,19 @@ import node from "eslint-plugin-n";
9
9
  import perfectionist from "eslint-plugin-perfectionist";
10
10
  import unusedImports from "eslint-plugin-unused-imports";
11
11
  function daopk(options = {}, ...userConfigs) {
12
+ const stylisticConfig = stylistic.configs.customize({
13
+ arrowParens: options.arrowParens ?? true,
14
+ blockSpacing: options.blockSpacing,
15
+ braceStyle: options.braceStyle,
16
+ commaDangle: options.commaDangle,
17
+ flat: true,
18
+ indent: options.indent ?? 4,
19
+ jsx: options.jsx,
20
+ pluginName: "stylistic",
21
+ quoteProps: options.quoteProps,
22
+ quotes: options.quotes ?? "single",
23
+ semi: options.semi ?? false
24
+ });
12
25
  const configs = [
13
26
  {
14
27
  ignores: [
@@ -20,7 +33,7 @@ function daopk(options = {}, ...userConfigs) {
20
33
  {
21
34
  name: "daopk/eslint",
22
35
  rules: {
23
- eqeqeq: "error",
36
+ "eqeqeq": "error",
24
37
  "no-cond-assign": ["error", "always"],
25
38
  "no-extra-boolean-cast": "error",
26
39
  "no-regex-spaces": "error",
@@ -36,16 +49,9 @@ function daopk(options = {}, ...userConfigs) {
36
49
  stylistic
37
50
  },
38
51
  rules: {
52
+ ...stylisticConfig.rules,
39
53
  "stylistic/array-bracket-newline": ["error", "consistent"],
40
- "stylistic/array-bracket-spacing": ["error", "never"],
41
- "stylistic/array-element-newline": ["error", "consistent"],
42
- "stylistic/brace-style": ["error", "1tbs", { "allowSingleLine": true }],
43
- "stylistic/comma-dangle": ["error", "always-multiline"],
44
- "stylistic/indent": ["error", 4],
45
- "stylistic/no-multi-spaces": "error",
46
- "stylistic/no-multiple-empty-lines": ["error", { "max": 1 }],
47
- "stylistic/quotes": ["error", "single"],
48
- "stylistic/semi": ["error", "never"]
54
+ "stylistic/array-element-newline": ["error", "consistent"]
49
55
  }
50
56
  },
51
57
  {
@@ -71,7 +77,7 @@ function daopk(options = {}, ...userConfigs) {
71
77
  {
72
78
  name: "daopk/imports",
73
79
  plugins: {
74
- import: importX,
80
+ "import": importX,
75
81
  "unused-imports": unusedImports
76
82
  },
77
83
  rules: {
@@ -86,10 +92,10 @@ function daopk(options = {}, ...userConfigs) {
86
92
  "unused-imports/no-unused-vars": [
87
93
  "warn",
88
94
  {
89
- "args": "after-used",
90
- "argsIgnorePattern": "^_",
91
- "vars": "all",
92
- "varsIgnorePattern": "^_"
95
+ args: "after-used",
96
+ argsIgnorePattern: "^_",
97
+ vars: "all",
98
+ varsIgnorePattern: "^_"
93
99
  }
94
100
  ]
95
101
  }
@@ -138,8 +144,7 @@ function daopk(options = {}, ...userConfigs) {
138
144
  type: "natural"
139
145
  }],
140
146
  "perfectionist/sort-named-exports": ["error", { order: "asc", type: "natural" }],
141
- "perfectionist/sort-named-imports": ["error", { order: "asc", type: "natural" }],
142
- "perfectionist/sort-objects": "error"
147
+ "perfectionist/sort-named-imports": ["error", { order: "asc", type: "natural" }]
143
148
  }
144
149
  }
145
150
  ];
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@daopk/eslint-config",
3
3
  "type": "module",
4
- "version": "0.0.3",
4
+ "version": "0.0.4",
5
5
  "license": "ISC",
6
6
  "repository": "github:daopk/eslint-config",
7
7
  "exports": {
@@ -35,10 +35,10 @@
35
35
  "typescript": "^5.7.3"
36
36
  },
37
37
  "scripts": {
38
- "build": "pnpm typegen && tsup",
38
+ "dev": "eslint-config-inspector",
39
39
  "typegen": "tsx scripts/typegen.ts",
40
- "inspector": "eslint-config-inspector",
41
- "inspector:build": "pnpm build && eslint-config-inspector build",
40
+ "build": "pnpm typegen && tsup",
41
+ "build:inspector": "pnpm build && eslint-config-inspector build",
42
42
  "lint": "eslint .",
43
43
  "release": "bumpp && pnpm publish"
44
44
  }