chore: tidying
This commit is contained in:
4
.vscode/settings.json
vendored
4
.vscode/settings.json
vendored
@ -1,7 +1,9 @@
|
|||||||
{
|
{
|
||||||
"typescript.tsdk": "node_modules/typescript/lib",
|
"typescript.tsdk": "node_modules/typescript/lib",
|
||||||
|
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
||||||
|
"editor.formatOnSave": true,
|
||||||
"editor.codeActionsOnSave": {
|
"editor.codeActionsOnSave": {
|
||||||
"source.fixAll.eslint": "explicit"
|
"source.fixAll": "explicit"
|
||||||
},
|
},
|
||||||
"eslint.validate": ["typescript", "typescriptreact", "javascript", "javascriptreact"],
|
"eslint.validate": ["typescript", "typescriptreact", "javascript", "javascriptreact"],
|
||||||
"javascript.preferences.importModuleSpecifier": "non-relative",
|
"javascript.preferences.importModuleSpecifier": "non-relative",
|
||||||
|
@ -1,15 +1,15 @@
|
|||||||
const path = require('path');
|
const path = require('path');
|
||||||
|
|
||||||
const buildEslintCommand = (filenames) =>
|
const eslint = (filenames) =>
|
||||||
`eslint --fix ${filenames.map((f) => `"${path.relative(process.cwd(), f)}"`).join(' ')}`;
|
`eslint --fix ${filenames.map((f) => `"${path.relative(process.cwd(), f)}"`).join(' ')}`;
|
||||||
|
|
||||||
const buildPrettierCommand = (filenames) =>
|
const prettier = (filenames) =>
|
||||||
`prettier --write ${filenames.map((f) => `"${path.relative(process.cwd(), f)}"`).join(' ')}`;
|
`prettier --write ${filenames.map((f) => `"${path.relative(process.cwd(), f)}"`).join(' ')}`;
|
||||||
|
|
||||||
/** @type {import('lint-staged').Config} */
|
/** @type {import('lint-staged').Config} */
|
||||||
module.exports = {
|
module.exports = {
|
||||||
'**/*.{ts,tsx,cts,mts}': [buildEslintCommand, buildPrettierCommand],
|
'**/*.{ts,tsx,cts,mts}': [eslint, prettier],
|
||||||
'**/*.{js,jsx,cjs,mjs}': [buildPrettierCommand],
|
'**/*.{js,jsx,cjs,mjs}': [prettier],
|
||||||
'**/*.{yml,mdx}': [buildPrettierCommand],
|
'**/*.{yml,mdx}': [prettier],
|
||||||
'**/*/package.json': 'npm run precommit',
|
'**/*/package.json': 'npm run precommit',
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user