加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
lint-staged.config.js 887 Bytes
一键复制 编辑 原始数据 按行查看 历史
/* eslint-disable */
// from: https://github.com/jupyterlab/jupyterlab/blob/master/lint-staged.config.js
const escape = require('shell-quote').quote;
const fs = require('fs');
const isWin = process.platform === 'win32';
const escapeFileNames = filenames =>
filenames
.filter(filename => fs.existsSync(filename))
.map(filename => `"${isWin ? filename : escape([filename])}"`)
.join(' ');
module.exports = {
'**/*{.css,.json,.md}': filenames => {
const escapedFileNames = escapeFileNames(filenames);
return [
`prettier --write ${escapedFileNames}`,
`git add -f ${escapedFileNames}`
];
},
'**/*{.ts,.tsx,.js,.jsx}': filenames => {
const escapedFileNames = escapeFileNames(filenames);
return [
`prettier --write ${escapedFileNames}`,
`eslint --fix ${escapedFileNames}`,
`git add -f ${escapedFileNames}`
];
}
};
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化