Vue-cli: .eslintrc is deprecated

Created on 16 Mar 2018  路  5Comments  路  Source: vuejs/vue-cli

Version

3.0.0-beta.6

Reproduction link

not-required

Steps to reproduce

Create a new Vue app activating ESLint.

What is expected?

Vue CLI should create a .eslintrc.json or .eslint.js file, due .eslintrc file is deprecated according to the ESLint documentation: https://eslint.org/docs/user-guide/configuring#configuration-file-formats

What is actually happening?

Vue CLI creates a .eslintrc file


Maybe the option to create a .eslintrc.js file will be better to place comments and solve conditional rules according to the NODE_ENV value

contribution welcome enhancement intend to implement next eslint

Most helpful comment

currently, the cli creates JSON, not Javascript code. JSON is also easier to augment for 3rd party plugins, since you can simply require the file, change the updated object and save the JSON back to disc, so I would vote for .eslintrc.json

All 5 comments

.eslintrc.js would also be my pick for the stated reasons.

And Babel 7 support .babelrc.js, PostCSS support postcss.config.js

currently, the cli creates JSON, not Javascript code. JSON is also easier to augment for 3rd party plugins, since you can simply require the file, change the updated object and save the JSON back to disc, so I would vote for .eslintrc.json

Just to note right now if someone were to do this the typescript plugin will change files that end in .js and don't contain config to a .ts file. If the config was a .eslintrc.js file it would end up as .eslintrc.ts which means the config file won't be found.

So .eslintrc.json would probably be a better default in any case.

@ascendancyy the jest plugin is generating jest.config.js just fine with typescript https://github.com/vuejs/vue-cli/blob/dev/packages/%40vue/cli-plugin-unit-jest/generator/index.js#L64. My vote would be for .eslintrc.js for this reason https://github.com/vuejs/vue-cli/blob/dev/packages/%40vue/cli-plugin-eslint/eslintOptions.js#L6-L7

Was this page helpful?
0 / 5 - 0 ratings

Related issues

JIANGYUJING1995 picture JIANGYUJING1995  路  3Comments

csakis picture csakis  路  3Comments

eladcandroid picture eladcandroid  路  3Comments

NathanKleekamp picture NathanKleekamp  路  3Comments

PrimozRome picture PrimozRome  路  3Comments