Ai
1 Star 0 Fork 0

Kcat/next.js

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
lint-staged.config.js 958 Bytes
一键复制 编辑 原始数据 按行查看 历史
matamatanot 提交于 2021-06-09 19:54 +08:00 . Replace CLIEngine with ESLint (#25801)
const escape = require('shell-quote').quote
const { ESLint } = require('eslint')
const eslint = new ESLint()
const isWin = process.platform === 'win32'
module.exports = {
'**/*.{js,jsx,ts,tsx}': (filenames) => {
const escapedFileNames = filenames
.map((filename) => `"${isWin ? filename : escape([filename])}"`)
.join(' ')
return [
`prettier --with-node-modules --ignore-path .prettierignore_staged --write ${escapedFileNames}`,
`eslint --no-ignore --max-warnings=0 --fix ${filenames
.filter((file) => !eslint.isPathIgnored(file))
.map((f) => `"${f}"`)
.join(' ')}`,
]
},
'**/*.{json,md,mdx,css,html,yml,yaml,scss}': (filenames) => {
const escapedFileNames = filenames
.map((filename) => `"${isWin ? filename : escape([filename])}"`)
.join(' ')
return [
`prettier --with-node-modules --ignore-path .prettierignore_staged --write ${escapedFileNames}`,
]
},
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/imkcat/next.js.git
git@gitee.com:imkcat/next.js.git
imkcat
next.js
next.js
canary

搜索帮助