@dvukovic/style-guide 0.7.0 → 0.9.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
@@ -5,7 +5,7 @@ Personal style guide with ESLint, Prettier, Stylelint, and CSpell configurations
5
5
  ## Quick Start
6
6
 
7
7
  ```bash
8
- npx @dvukovic/style-guide init
8
+ npx -y @dvukovic/style-guide@latest init
9
9
  ```
10
10
 
11
11
  This interactive CLI will:
@@ -88,11 +88,11 @@ export default config
88
88
  Create `stylelint.config.js`:
89
89
 
90
90
  ```js
91
- import stylelintConfig from "@dvukovic/style-guide/stylelint"
91
+ import { core } from "@dvukovic/style-guide/stylelint"
92
92
 
93
93
  /** @type {import("stylelint").Config} */
94
94
  const config = {
95
- ...stylelintConfig,
95
+ ...core,
96
96
  }
97
97
 
98
98
  export default config
@@ -103,12 +103,12 @@ export default config
103
103
  Create `cspell.config.js`:
104
104
 
105
105
  ```js
106
- import cspellConfig from "@dvukovic/style-guide/cspell"
106
+ import { core } from "@dvukovic/style-guide/cspell"
107
107
 
108
108
  /** @type {import("cspell").FileSettings} */
109
109
  const config = {
110
- ...cspellConfig,
111
- ignorePaths: [],
110
+ ...core,
111
+ ignorePaths: [...core.ignorePaths],
112
112
  ignoreWords: [],
113
113
  }
114
114
 
@@ -10,4 +10,3 @@ export function promptESLintOptions(): Promise<{
10
10
  }>;
11
11
  export function promptOverwrite(filename: any): Promise<boolean>;
12
12
  export function promptInstall(packageManager: any, packages: any): Promise<boolean>;
13
- export function promptAddScripts(): Promise<boolean>;
@@ -1 +1 @@
1
- export { default as core, default } from "./configs/core.js";
1
+ export { default as core } from "./configs/core.js";
@@ -1 +1 @@
1
- export { default as core, default } from "./configs/core.js";
1
+ export { default as core } from "./configs/core.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dvukovic/style-guide",
3
- "version": "0.7.0",
3
+ "version": "0.9.0",
4
4
  "description": "My own style guide",
5
5
  "repository": {
6
6
  "type": "git",
@@ -22,7 +22,7 @@
22
22
  "default": "./src/eslint/index.js"
23
23
  },
24
24
  "./knip": {
25
- "types": "./dist/knip/index.d.ts",
25
+ "types": "./src/knip/index.d.ts",
26
26
  "default": "./src/knip/index.js"
27
27
  },
28
28
  "./prettier": {
@@ -1,10 +1,10 @@
1
1
  export function generateCspellConfig() {
2
- return `import cspellConfig from "@dvukovic/style-guide/cspell"
2
+ return `import { core } from "@dvukovic/style-guide/cspell"
3
3
 
4
4
  /** @type {import("cspell").FileSettings} */
5
5
  const config = {
6
- ...cspellConfig,
7
- ignorePaths: [],
6
+ ...core,
7
+ ignorePaths: [...core.ignorePaths],
8
8
  ignoreWords: [],
9
9
  }
10
10
 
@@ -1,9 +1,9 @@
1
1
  export function generateStylelintConfig() {
2
- return `import stylelintConfig from "@dvukovic/style-guide/stylelint"
2
+ return `import { core } from "@dvukovic/style-guide/stylelint"
3
3
 
4
4
  /** @type {import("stylelint").Config} */
5
5
  const config = {
6
- ...stylelintConfig,
6
+ ...core,
7
7
  }
8
8
 
9
9
  export default config
package/src/cli/init.js CHANGED
@@ -11,7 +11,6 @@ import { generatePrettierConfig } from "./generators/prettier.js"
11
11
  import { generateScripts } from "./generators/scripts.js"
12
12
  import { generateStylelintConfig } from "./generators/stylelint.js"
13
13
  import {
14
- promptAddScripts,
15
14
  promptESLintOptions,
16
15
  promptInstall,
17
16
  promptOverwrite,
@@ -114,14 +113,12 @@ async function writeConfigFile(filename, content) {
114
113
  if (!overwrite) {
115
114
  clack.log.info(`Skipped ${filename}`)
116
115
 
117
- return false
116
+ return
118
117
  }
119
118
  }
120
119
 
121
120
  await writeFile(filename, content)
122
121
  clack.log.success(`Created ${filename}`)
123
-
124
- return true
125
122
  }
126
123
 
127
124
  async function updatePackageJsonScripts(tools, packageManager) {
@@ -167,7 +164,6 @@ export async function runInit() {
167
164
  eslintOptions = await promptESLintOptions()
168
165
  }
169
166
 
170
- const shouldAddScripts = await promptAddScripts()
171
167
  const packageManager = detectPackageManager()
172
168
 
173
169
  await installPackages(tools, packageManager)
@@ -215,7 +211,5 @@ export async function runInit() {
215
211
  await writeConfigFile(filename, content)
216
212
  }
217
213
 
218
- if (shouldAddScripts) {
219
- await updatePackageJsonScripts(tools, packageManager)
220
- }
214
+ await updatePackageJsonScripts(tools, packageManager)
221
215
  }
@@ -154,7 +154,7 @@ export async function promptESLintOptions() {
154
154
 
155
155
  export async function promptOverwrite(filename) {
156
156
  const overwrite = await clack.confirm({
157
- initialValue: false,
157
+ initialValue: true,
158
158
  message: `${filename} already exists. Overwrite?`,
159
159
  })
160
160
 
@@ -181,16 +181,3 @@ export async function promptInstall(packageManager, packages) {
181
181
 
182
182
  return install
183
183
  }
184
-
185
- export async function promptAddScripts() {
186
- const addScripts = await clack.confirm({
187
- initialValue: true,
188
- message: "Add lint scripts to package.json?",
189
- })
190
-
191
- if (clack.isCancel(addScripts)) {
192
- return false
193
- }
194
-
195
- return addScripts
196
- }
@@ -12,6 +12,7 @@ const config = {
12
12
  path: "./node_modules/@dvukovic/style-guide/cspell/base.txt",
13
13
  },
14
14
  ],
15
+ ignorePaths: ["TODO.md", "tsconfig.tsbuildinfo", "CHANGELOG.md"],
15
16
  useGitignore: true,
16
17
  }
17
18
 
@@ -1 +1 @@
1
- export { default as core, default } from "./configs/core.js"
1
+ export { default as core } from "./configs/core.js"
@@ -19,6 +19,10 @@ export function customDefineConfig(ignores, configs = []) {
19
19
  "./*.config.js",
20
20
  "./*.config.cjs",
21
21
  "./*.config.mjs",
22
+ "next-env.d.ts",
23
+ ".next",
24
+ "**/__generated__/**",
25
+ "**/*.d.json.ts",
22
26
  ...ignores,
23
27
  ]),
24
28
  ...configs,
@@ -1 +1 @@
1
- export { default as core, default } from "./configs/core.js"
1
+ export { default as core } from "./configs/core.js"