Skip to content

Commit 8cee5b4

Browse files
committed
chore: extend lint-staged to *.{mjs,yml,yaml}; add mjs sourceType override in ESLint
1 parent 1aa9462 commit 8cee5b4

2 files changed

Lines changed: 12 additions & 5 deletions

File tree

eslint.config.mjs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,7 @@ export default [
3737
'no-return-assign': ['error', 'except-parens'],
3838
'no-self-compare': 'error',
3939
'no-throw-literal': 'error',
40-
'no-unused-expressions': [
41-
'error',
42-
{ allowShortCircuit: true, allowTernary: true, allowTaggedTemplates: true },
43-
],
40+
'no-unused-expressions': ['error', { allowShortCircuit: true, allowTernary: true, allowTaggedTemplates: true }],
4441
'no-useless-return': 'error',
4542

4643
// Modern JavaScript
@@ -51,6 +48,13 @@ export default [
5148
'no-duplicate-imports': 'error',
5249
},
5350
},
51+
{
52+
// Config files use ES module syntax
53+
files: ['*.mjs'],
54+
languageOptions: {
55+
sourceType: 'module',
56+
},
57+
},
5458
{
5559
// Test files configuration
5660
files: ['tests/**/*.js', '**/*.test.js'],

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,12 +98,15 @@
9898
"vitest": "^3.2.4"
9999
},
100100
"lint-staged": {
101-
"*.js": [
101+
"*.{js,mjs}": [
102102
"eslint --fix",
103103
"prettier --write"
104104
],
105105
"*.md": [
106106
"prettier --write --prose-wrap preserve"
107+
],
108+
"*.{yml,yaml}": [
109+
"prettier --write"
107110
]
108111
}
109112
}

0 commit comments

Comments
 (0)