Open fengyuanchen opened 3 years ago
api.extendPackage
will just change package.json
, It does not rewrite your lint-staged.config.js
file
so it is recommended that you use fs
do anything you want
const targetPath = path.join(api.getCwd(), './lint-staged.config.js')
let content = fs.readFileSync(targetPath, {
encoding: 'utf-8',
})
content = content.replace('*.{js,jsx,vue}', '*.{css,scss,sass,html,vue}')
fs.writeFileSync(targetPath, content)
Version
5.0.0-beta.2
Environment info
Steps to reproduce
vue create my-project
:@my/vue-cli-plugin-stylelint
:vue add @my/vue-cli-plugin-stylelint
.lint-staged.config.js
file.What is expected?
What is actually happening?
I guess the place that may go wrong is here.