Skip to content

Commit be2e993

Browse files
feat: allow config key sorting on files not named nuxt.config (#630)
1 parent 702db7c commit be2e993

File tree

3 files changed

+2
-4
lines changed

3 files changed

+2
-4
lines changed

packages/eslint-config/src/configs/nuxt.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ export default function nuxt(options: NuxtESLintConfigOptions): Linter.Config[]
5454
configs.push({
5555
name: 'nuxt/sort-config',
5656
files: [
57+
'**/.config/nuxt.?([cm])[jt]s?(x)',
5758
'**/nuxt.config.?([cm])[jt]s?(x)',
5859
],
5960
rules: {

packages/eslint-config/test/__snapshots__/flat-compose.test.ts.snap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,7 @@ exports[`flat config composition > with stylistic 1`] = `
294294
},
295295
{
296296
"files": [
297+
"**/.config/nuxt.?([cm])[jt]s?(x)",
297298
"**/nuxt.config.?([cm])[jt]s?(x)",
298299
],
299300
"name": "nuxt/sort-config",

packages/eslint-plugin/src/rules/nuxt-config-keys-order/index.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,6 @@ export const rule = createRule<MessageIds, Options>({
2121
},
2222
defaultOptions: [],
2323
create(context) {
24-
if (!context.filename.match(/nuxt\.config\.[mc]?[jt]sx?$/)) {
25-
return {}
26-
}
27-
2824
return {
2925
ExportDefaultDeclaration(node) {
3026
let object: Tree.ObjectExpression | undefined

0 commit comments

Comments
 (0)