Skip to content

Commit

Permalink
fix: reorder prettier in lintfix to avoid eslint conflicts, fix nuxt#827
Browse files Browse the repository at this point in the history
  • Loading branch information
scscgit committed Sep 6, 2021
1 parent 6585d22 commit 9a5a997
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions packages/cna-template/template/nuxt/package.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,11 @@ module.exports = {
prettier: '<%= pmRun %> lint:prettier'
}
const lintfixScripts = {
// prettier before eslint to avoid conflicting rules like no-return-assign
// without having to use prettier via eslint (plugin:prettier/recommended)
prettier: 'prettier --write --list-different .',
eslint: "<%= pmRun %> lint:js <%= pm === 'npm' ? '-- ' : '' %>--fix",
stylelint: "<%= pmRun %> lint:style <%= pm === 'npm' ? '-- ' : '' %>--fix",
prettier: 'prettier --write --list-different .'
stylelint: "<%= pmRun %> lint:style <%= pm === 'npm' ? '-- ' : '' %>--fix"
}

if (!eslint) {
Expand Down
2 changes: 1 addition & 1 deletion packages/create-nuxt-app/test/snapshots/index.test.js.md
Original file line number Diff line number Diff line change
Expand Up @@ -2122,7 +2122,7 @@ Generated by [AVA](https://avajs.dev).
'lint:js': 'eslint --ext ".js,.vue" --ignore-path .gitignore .',
'lint:prettier': 'prettier --check .',
'lint:style': 'stylelint "**/*.{css,scss,sass,html,vue}" --ignore-path .gitignore',
lintfix: 'yarn lint:js --fix && yarn lint:style --fix && prettier --write --list-different .',
lintfix: 'prettier --write --list-different . && yarn lint:js --fix && yarn lint:style --fix',
prepare: 'husky install',
start: 'nuxt start',
},
Expand Down
Binary file modified packages/create-nuxt-app/test/snapshots/index.test.js.snap
Binary file not shown.

0 comments on commit 9a5a997

Please sign in to comment.