Skip to content

Commit 0891f05

Browse files
committed
Revert "fix: require.resolve eslint parser"
This reverts commit 3a0caa6.
1 parent 3a0caa6 commit 0891f05

File tree

3 files changed

+2
-8
lines changed

3 files changed

+2
-8
lines changed

packages/@vue/cli-plugin-eslint/eslintOptions.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ exports.config = (api, preset, rootOptions = {}) => {
1414

1515
if (api.hasPlugin('babel') && !api.hasPlugin('typescript')) {
1616
config.parserOptions = {
17-
parser: makeJSOnlyValue(`require.resolve('babel-eslint')`)
17+
parser: 'babel-eslint'
1818
}
1919
}
2020

@@ -59,7 +59,6 @@ function makeJSOnlyValue (str) {
5959
fn.__expression = str
6060
return fn
6161
}
62-
exports.makeJSOnlyValue = makeJSOnlyValue
6362

6463
const baseExtensions = ['.js', '.jsx', '.vue']
6564
exports.extensions = api => api.hasPlugin('typescript')

packages/@vue/cli-plugin-eslint/generator/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ module.exports.applyTS = api => {
9797
eslintConfig: {
9898
extends: ['@vue/typescript'],
9999
parserOptions: {
100-
parser: require('../eslintOptions').makeJSOnlyValue(`require.resolve('@typescript-eslint/parser')`)
100+
parser: '@typescript-eslint/parser'
101101
}
102102
},
103103
devDependencies: require('../eslintDeps').DEPS_MAP.typescript

packages/@vue/cli/lib/Generator.js

-5
Original file line numberDiff line numberDiff line change
@@ -219,11 +219,6 @@ module.exports = class Generator {
219219
// project-wide configuration even to dependencies.
220220
// TODO: this can be removed when Babel supports root: true in package.json
221221
extract('babel')
222-
223-
// Always extract .eslintrc.js as the parser needs to be require.resolve'ed
224-
// since ESLint doesn't resolve things from where it's declared
225-
// TODO: this can be removed when ESLint starts resolving things correctly
226-
extract('eslint')
227222
}
228223
}
229224

0 commit comments

Comments
 (0)