Skip to content

Commit

Permalink
fix: eslint should override env for **/tests/** subfolders (vuejs#4447)
Browse files Browse the repository at this point in the history
  • Loading branch information
LinusBorg authored and haoqunjiang committed Aug 21, 2019
1 parent 86f4f5f commit 58177d2
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
13 changes: 13 additions & 0 deletions packages/@vue/cli-plugin-unit-jest/generator/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,19 @@ module.exports = (api, _, __, invoking) => {

if (api.hasPlugin('eslint')) {
applyESLint(api)

api.extendPackage({
eslintConfig: {
overrides: [
{
files: ['**/__tests__/*.{j,t}s?(x)'],
env: {
jest: true
}
}
]
}
})
}
}

Expand Down
12 changes: 12 additions & 0 deletions packages/@vue/cli-plugin-unit-mocha/generator/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,18 @@ module.exports = (api, _, __, invoking) => {

if (api.hasPlugin('eslint')) {
applyESLint(api)
api.extendPackage({
eslintConfig: {
overrides: [
{
files: ['**/__tests__/*.{j,t}s?(x)'],
env: {
mocha: true
}
}
]
}
})
}

if (api.hasPlugin('typescript')) {
Expand Down

0 comments on commit 58177d2

Please sign in to comment.