Skip to content

Commit

Permalink
build(eslint): optimize jsonc/comma-dangle config
Browse files Browse the repository at this point in the history
  • Loading branch information
tjx666 committed Jul 7, 2024
1 parent 31411c8 commit 9dd936c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
9 changes: 9 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
process.env.ESLINT_TSCONFIG = 'tsconfig.json'
const jsonExtJsoncFiles = ['**/tsconfig.*.json', '.vscode/*.json']

module.exports = {
root: true,
Expand Down Expand Up @@ -324,6 +325,7 @@ module.exports = {

// this will cause many changes when auto fix package.json
'jsonc/sort-keys': 'off',
'jsonc/comma-dangle': ['error', 'always-multiline'],
},

overrides: [
Expand All @@ -334,5 +336,12 @@ module.exports = {
'unicorn/prefer-node-protocol': 'off',
},
},
{
files: ['*.json'],
excludedFiles: jsonExtJsoncFiles,
rules: {
'jsonc/comma-dangle': 'off',
},
},
],
}
8 changes: 4 additions & 4 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,20 @@
"kobalte",
"lucide",
"iconbox",
"Zustand"
"Zustand",
],
"svg.preview.background": "transparent",

// use eslint codeActionOnSave to format
"prettier.enable": false,
"editor.formatOnSave": false,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
"source.fixAll.eslint": "explicit",
},

"tailwindCSS.experimental.classRegex": [
"\\b(?:class|className): *`((.|\n)*?)`",
"\\b(?:class|className): *\"((.|\n)*?)\"",
"\\b(?:class|className): *'((.|\n)*?)'"
]
"\\b(?:class|className): *'((.|\n)*?)'",
],
}

0 comments on commit 9dd936c

Please sign in to comment.