@dvukovic/style-guide 0.3.98 → 0.3.100

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
@@ -56,6 +56,24 @@ export default customDefineConfig(
56
56
  )
57
57
  ```
58
58
 
59
+ ### Scripts
60
+
61
+ Add these scripts to your `package.json`:
62
+
63
+ ```json
64
+ {
65
+ "scripts": {
66
+ "lint": "yarn lint:eslint && yarn lint:prettier && yarn lint:stylelint && yarn lint:spell",
67
+ "lint:eslint": "eslint . --cache --concurrency=auto",
68
+ "lint:fix": "yarn lint:eslint --fix && yarn lint:prettier --write && yarn lint:stylelint --fix && yarn lint:spell",
69
+ "lint:prettier": "prettier --check --cache .",
70
+ "lint:spell": "cspell --config ./.cspellrc.js --no-progress --no-summary --unique '**'",
71
+ "lint:stylelint": "stylelint ./**/*.css --cache",
72
+ "test": "vitest run"
73
+ }
74
+ }
75
+ ```
76
+
59
77
  ### Complete Example
60
78
 
61
79
  A full-featured project (this is the actual config used by this package):
@@ -95,9 +113,15 @@ export default customDefineConfig(
95
113
  ## Prettier Configuration
96
114
 
97
115
  ```js
98
- import { prettier } from "@dvukovic/style-guide/prettier"
116
+ import type { Config } from "prettier"
117
+
118
+ import core from "@dvukovic/style-guide/src/prettier/configs/core.js"
119
+
120
+ const config: Config = {
121
+ ...core,
122
+ }
99
123
 
100
- export default prettier
124
+ export default config
101
125
  ```
102
126
 
103
127
  ## Stylelint Configuration
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dvukovic/style-guide",
3
- "version": "0.3.98",
3
+ "version": "0.3.100",
4
4
  "description": "My own style guide",
5
5
  "repository": {
6
6
  "type": "git",
@@ -9,7 +9,20 @@ import { defineConfig, globalIgnores } from "eslint/config"
9
9
  * @returns {Array} ESLint configuration
10
10
  */
11
11
  export function customDefineConfig(ignores, configs = []) {
12
- return defineConfig(globalIgnores(["node_modules", ...ignores]), ...configs)
12
+ return defineConfig(
13
+ globalIgnores([
14
+ "node_modules",
15
+ "./*.js",
16
+ "./*.ts",
17
+ "./*.cjs",
18
+ "./*.mjs",
19
+ "./*.config.js",
20
+ "./*.config.cjs",
21
+ "./*.config.mjs",
22
+ ...ignores,
23
+ ]),
24
+ ...configs,
25
+ )
13
26
  }
14
27
 
15
28
  export * from "./configs/core.js"
@@ -19,7 +32,6 @@ export * from "./configs/next.js"
19
32
  export * from "./configs/node.js"
20
33
  export * from "./configs/playwright.js"
21
34
  export * from "./configs/react.js"
22
- export * from "./configs/storybook.js"
23
35
  export * from "./configs/typescript.js"
24
36
  export * from "./configs/typescript-strict.js"
25
37
  export * from "./configs/vitest.js"
@@ -30,7 +30,6 @@ export const eslint = {
30
30
  "func-names": ["error", "as-needed"],
31
31
  "func-style": ["error", "declaration", { allowArrowFunctions: true }],
32
32
  "id-length": ["error", { exceptions: ["x", "y", "z"], min: 2, properties: "never" }],
33
- "logical-assignment-operators": ["error", "never"],
34
33
  "max-classes-per-file": ["error", 1],
35
34
  "max-depth": ["error", 4],
36
35
  "max-lines": ["error", 1200],
@@ -6,7 +6,6 @@ export const promise = {
6
6
  promise: plugin,
7
7
  },
8
8
  rules: {
9
- "promise/always-return": "error",
10
9
  "promise/catch-or-return": "error",
11
10
  "promise/no-callback-in-promise": "error",
12
11
  "promise/no-multiple-resolved": "error",
@@ -41,7 +41,6 @@ export const sonarjs = {
41
41
  "sonarjs/class-name": "error",
42
42
  "sonarjs/class-prototype": "error",
43
43
  "sonarjs/code-eval": "error",
44
- "sonarjs/cognitive-complexity": "error",
45
44
  "sonarjs/comma-or-logical-or-case": "error",
46
45
  "sonarjs/comment-regex": "error",
47
46
  "sonarjs/concise-regex": "error",
@@ -54,7 +53,6 @@ export const sonarjs = {
54
53
  "sonarjs/cookies": "error",
55
54
  "sonarjs/cors": "error",
56
55
  "sonarjs/csrf": "error",
57
- "sonarjs/cyclomatic-complexity": "error",
58
56
  "sonarjs/deprecation": "error",
59
57
  "sonarjs/destructuring-assignment-syntax": "error",
60
58
  "sonarjs/different-types-comparison": "error",
@@ -63,13 +61,11 @@ export const sonarjs = {
63
61
  "sonarjs/disabled-timeout": "error",
64
62
  "sonarjs/dns-prefetching": "error",
65
63
  "sonarjs/duplicates-in-character-class": "error",
66
- "sonarjs/elseif-without-else": "error",
67
64
  "sonarjs/empty-string-repetition": "error",
68
65
  "sonarjs/encryption": "error",
69
66
  "sonarjs/encryption-secure-mode": "error",
70
67
  "sonarjs/enforce-trailing-comma": "error",
71
68
  "sonarjs/existing-groups": "error",
72
- "sonarjs/expression-complexity": "error",
73
69
  "sonarjs/file-permissions": "error",
74
70
  "sonarjs/file-uploads": "error",
75
71
  "sonarjs/fixme-tag": "error",
@@ -77,7 +73,6 @@ export const sonarjs = {
77
73
  "sonarjs/for-loop-increment-sign": "error",
78
74
  "sonarjs/frame-ancestors": "error",
79
75
  "sonarjs/function-inside-loop": "error",
80
- "sonarjs/function-return-type": "error",
81
76
  "sonarjs/future-reserved-words": "error",
82
77
  "sonarjs/generator-without-yield": "error",
83
78
  "sonarjs/hashing": "error",
@@ -92,7 +87,6 @@ export const sonarjs = {
92
87
  "sonarjs/label-position": "error",
93
88
  "sonarjs/link-with-target-blank": "error",
94
89
  "sonarjs/max-lines": "error",
95
- "sonarjs/max-lines-per-function": "error",
96
90
  "sonarjs/max-switch-cases": "error",
97
91
  "sonarjs/max-union-size": "error",
98
92
  "sonarjs/misplaced-loop-counter": "error",
@@ -144,7 +138,6 @@ export const sonarjs = {
144
138
  "sonarjs/no-implicit-global": "error",
145
139
  "sonarjs/no-in-misuse": "error",
146
140
  "sonarjs/no-incomplete-assertions": "error",
147
- "sonarjs/no-inconsistent-returns": "error",
148
141
  "sonarjs/no-incorrect-string-concat": "error",
149
142
  "sonarjs/no-internal-api-use": "error",
150
143
  "sonarjs/no-intrusive-permissions": "error",
@@ -160,7 +153,6 @@ export const sonarjs = {
160
153
  "sonarjs/no-mixed-content": "error",
161
154
  "sonarjs/no-nested-assignment": "error",
162
155
  "sonarjs/no-nested-conditional": "error",
163
- "sonarjs/no-nested-functions": "error",
164
156
  "sonarjs/no-nested-incdec": "error",
165
157
  "sonarjs/no-nested-switch": "error",
166
158
  "sonarjs/no-nested-template-literals": "error",
@@ -192,7 +184,6 @@ export const sonarjs = {
192
184
  "sonarjs/no-unthrown-error": "error",
193
185
  "sonarjs/no-unused-collection": "error",
194
186
  "sonarjs/no-unused-function-argument": "error",
195
- "sonarjs/no-unused-vars": "error",
196
187
  "sonarjs/no-use-of-empty-return-value": "error",
197
188
  "sonarjs/no-useless-catch": "error",
198
189
  "sonarjs/no-useless-increment": "error",
@@ -227,7 +218,6 @@ export const sonarjs = {
227
218
  "sonarjs/redundant-type-aliases": "error",
228
219
  "sonarjs/regex-complexity": "error",
229
220
  "sonarjs/session-regeneration": "error",
230
- "sonarjs/shorthand-property-grouping": "error",
231
221
  "sonarjs/single-char-in-character-classes": "error",
232
222
  "sonarjs/single-character-alternation": "error",
233
223
  "sonarjs/sockets": "error",
@@ -1,19 +0,0 @@
1
- /**
2
- * @typedef {Object} ConfigOptions
3
- * @property {boolean} [replace=false] - If true, replaces default config entirely with custom
4
- * configs. Default is `false`
5
- * @property {any[]} [configs=[]] - Additional configs to append or use as replacement. Default is
6
- * `[]`
7
- */
8
-
9
- /**
10
- * @typedef {Object} TypeScriptConfigOptions
11
- * @property {boolean} [replace=false] - If true, replaces default config entirely with custom
12
- * configs. Default is `false`
13
- * @property {any[]} [configs=[]] - Additional configs to append or use as replacement. Default is
14
- * `[]`
15
- * @property {string} [tsconfigPath="./tsconfig.json"] - Path to tsconfig.json file. Default is
16
- * `"./tsconfig.json"`
17
- */
18
-
19
- export {}