fg-devkit 1.21.4 → 1.22.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.
@@ -15,6 +15,7 @@ body = """
15
15
  - {% if commit.breaking %}[**breaking**] {% endif %}{{ commit.raw_message | split(pat="\n") | first | trim }}\
16
16
  {% endfor %}
17
17
  {% endfor %}
18
+
18
19
  """
19
20
  trim = true
20
21
  render_always = true
@@ -7,6 +7,7 @@ export interface CreateBaseConfigOptions {
7
7
  extraNonTypeAwareFiles?: string[]
8
8
  enablePrettier?: boolean
9
9
  enableI18n?: boolean
10
+ enableA11y?: boolean
10
11
  i18nLocaleDir?: string
11
12
  additionalRules?: Linter.RulesRecord
12
13
  additionalPlugins?: NonNullable<Linter.Config['plugins']>
@@ -8,6 +8,7 @@ import pluginVitest from '@vitest/eslint-plugin'
8
8
  import skipFormatting from '@vue/eslint-config-prettier/skip-formatting'
9
9
  import pluginPrettier from 'eslint-plugin-prettier'
10
10
  import pluginVue from 'eslint-plugin-vue'
11
+ import pluginVueA11y from 'eslint-plugin-vuejs-accessibility'
11
12
  import { globalIgnores } from 'eslint/config'
12
13
  import vueParser from 'vue-eslint-parser'
13
14
 
@@ -19,6 +20,7 @@ export default function createBaseConfig(options = {}) {
19
20
  extraNonTypeAwareFiles = [],
20
21
  enablePrettier = false,
21
22
  enableI18n = false,
23
+ enableA11y = false,
22
24
  i18nLocaleDir = './src/lang/*.json',
23
25
  additionalRules = {},
24
26
  additionalPlugins = {},
@@ -120,6 +122,7 @@ export default function createBaseConfig(options = {}) {
120
122
  ...additionalIgnores,
121
123
  ]),
122
124
  ...pluginVue.configs['flat/essential'],
125
+ ...(enableA11y ? pluginVueA11y.configs['flat/recommended'] : []),
123
126
  {
124
127
  ...pluginVitest.configs.recommended,
125
128
  files: ['**/__tests__/**', '**/*.test.*', '**/*.spec.*'],
@@ -250,11 +253,20 @@ export default function createBaseConfig(options = {}) {
250
253
  ...additionalRules,
251
254
  },
252
255
  },
253
- // JS/CJS files config
256
+ // @typescript-eslint/no-unused-vars needs the TS parser + types; on plain JS it
257
+ // false-positives as "assigned a value but only used as a type".
254
258
  {
255
- files: ['**/*.js', '**/*.cjs'],
259
+ files: ['**/*.{js,cjs,mjs}'],
256
260
  rules: {
257
261
  '@typescript-eslint/no-var-requires': 'off',
262
+ '@typescript-eslint/no-unused-vars': 'off',
263
+ 'no-unused-vars': [
264
+ 'warn',
265
+ {
266
+ argsIgnorePattern: '^_',
267
+ varsIgnorePattern: '^_',
268
+ },
269
+ ],
258
270
  },
259
271
  },
260
272
  skipFormatting,
@@ -12,6 +12,7 @@ export default [
12
12
  extraNonTypeAwareFiles: ['playwright.config.ts', 'poeditor/**/*.ts'],
13
13
  enablePrettier: true,
14
14
  enableI18n: true,
15
+ enableA11y: true,
15
16
  i18nLocaleDir: './src/lang/*.json',
16
17
  }),
17
18
  ]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fg-devkit",
3
- "version": "1.21.4",
3
+ "version": "1.22.0",
4
4
  "description": "Shared configs, scripts, and DX tooling for Vue / TypeScript frontend repos",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",
@@ -128,6 +128,7 @@
128
128
  "eslint": "10.12.0",
129
129
  "eslint-plugin-prettier": "5.5.6",
130
130
  "eslint-plugin-vue": "10.11.1",
131
+ "eslint-plugin-vuejs-accessibility": "2.6.2",
131
132
  "fallow": "3.32.0",
132
133
  "git-cliff": "2.14.2",
133
134
  "lefthook": "2.1.17",
@@ -32,7 +32,7 @@
32
32
  "@intlify/unplugin-vue-i18n": "11.2.5",
33
33
  "@tanstack/vue-query-devtools": "6.3.1",
34
34
  "@types/node": "22.16.5",
35
- "fg-devkit": "1.21.4",
35
+ "fg-devkit": "1.22.0",
36
36
  "@vitejs/plugin-vue": "6.0.9",
37
37
  "tailwindcss": "4.3.3",
38
38
  "tsx": "4.23.15",
@@ -566,7 +566,7 @@ Commands:
566
566
  generate-release-notes [--tag=vX.Y.Z]
567
567
  Generate CHANGELOG.md and user changelog via git-cliff
568
568
  verify-release-notes Interactive review step before committing release notes
569
- sync-release-notes-config Copy cliff configs and generate:release-notes script when missing
569
+ sync-release-notes-config Add CHANGELOG.user.md and generate:release-notes script when missing
570
570
  commit [args...] czg/cz-git with fg-devkit bundled config
571
571
  commit-vuln Commit staged dependency bumps as vuln() (alias: vuln-commit)
572
572
  lint [eslint-args...] Run ESLint using fg-devkit bundled ESLint stack
@@ -1,7 +1,10 @@
1
1
  #!/usr/bin/env node
2
2
  /**
3
- * Copy default cliff configs into a consumer repo when missing and ensure the
4
- * generate-release-notes npm script is present.
3
+ * Ensure CHANGELOG.user.md and the generate-release-notes npm script are present.
4
+ *
5
+ * cliff.toml / cliff.user.toml are not copied: generate-release-notes uses the configs
6
+ * bundled with fg-devkit, so config fixes reach every repo on the next fg-devkit bump.
7
+ * A repo only needs its own cliff config to override the bundled one.
5
8
  *
6
9
  * Usage:
7
10
  * node node_modules/fg-devkit/scripts/sync-release-notes-config.mjs
@@ -10,29 +13,10 @@
10
13
 
11
14
  import fs from 'node:fs'
12
15
  import path from 'node:path'
13
- import { fgRoot } from './release-notes-common.mjs'
14
16
 
15
17
  const REQUIRED_SCRIPT = 'generate:release-notes'
16
18
  const REQUIRED_SCRIPT_VALUE = 'pnpm exec fgd generate-release-notes'
17
19
 
18
- const CONFIG_FILES = ['cliff.toml', 'cliff.user.toml']
19
-
20
- function copyIfMissing(fileName, cwd) {
21
- const target = path.join(cwd, fileName)
22
- if (fs.existsSync(target)) {
23
- return null
24
- }
25
-
26
- const source = path.join(fgRoot, 'configs', fileName)
27
- if (!fs.existsSync(source)) {
28
- console.error(`[sync-release-notes-config] Missing template: ${source}`)
29
- process.exit(1)
30
- }
31
-
32
- fs.copyFileSync(source, target)
33
- return fileName
34
- }
35
-
36
20
  function ensureUserChangelog(cwd) {
37
21
  const target = path.join(cwd, 'CHANGELOG.user.md')
38
22
  if (fs.existsSync(target)) {
@@ -53,13 +37,6 @@ function main() {
53
37
  }
54
38
 
55
39
  const copied = []
56
- for (const fileName of CONFIG_FILES) {
57
- const result = copyIfMissing(fileName, cwd)
58
- if (result) {
59
- copied.push(result)
60
- }
61
- }
62
-
63
40
  const createdChangelog = ensureUserChangelog(cwd)
64
41
  if (createdChangelog) {
65
42
  copied.push(createdChangelog)