The instructions presented here are highly recommended as they provide the most effective configuration for using eslint, prettier and editorconfig together in react.js || next.js.
npm i -g eslint
eslint --init? How would you like to use ESLint?
> To check syntax, find problems, and enforce code style
? How would you like to define a style for your project?
> Use a popular style guide
? Which style guide do you want to follow?
> Standard: https://github.com/standard/standard
? What format do you want your config file to be in?
> JSON
mkdir .vscode
cd .vscode
echo {}> settings.json{
"editor.codeActionsOnSave": {
"source.fixAll": true,
"source.fixAll.eslint": true,
},
"editor.formatOnSave": true
}cd..
echo {}> .editorconfig
root = true
[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = false
insert_final_newline = falsenpm i -D prettier eslint-plugin-prettier eslint-config-prettierecho {}> .prettierrc.ymltrailingComma: 'es5'
tabWidth: 2
semi: false
singleQuote: true{
"settings": {
"react": {
"version": "detect"
}
},
"env": {
"browser": true,
"es2021": true
},
"extends": [
"plugin:react/recommended",
"standard",
"plugin:prettier/recommended"
],
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": ["react"],
"rules": {
"react/no-unknown-property": 0,
"no-unused-vars": "off",
"prettier/prettier": [
"error",
{
"singleQuote": true,
"semi": false
}
],
"react/prop-types": 0
}
}






