Required to install eslint-config-prettier eslint-plugin-prettier as dev dependencies.
To lint your files add this in your package.json:
{
//...
"scripts": {
//...
"lint": "eslint ./path/to/files/** --ext .ts --ext .tsx --fix"
}
}| module.exports = { | |
| env: { | |
| browser: true, | |
| es2021: true, | |
| node: true | |
| }, | |
| extends: ['plugin:react/recommended', 'plugin:prettier/recommended', 'standard'], | |
| parser: '@typescript-eslint/parser', | |
| parserOptions: { | |
| ecmaFeatures: { | |
| jsx: true | |
| }, | |
| ecmaVersion: 12, | |
| sourceType: 'module' | |
| }, | |
| plugins: ['prettier', 'react', '@typescript-eslint'], | |
| rules: { | |
| 'prettier/prettier': 'error', | |
| 'no-use-before-define': [0], | |
| 'react/prop-types': 'off', | |
| 'react/display-name': 'off', | |
| 'no-undef': 'off', | |
| 'no-unused-vars': [0], | |
| camelcase: 'off', | |
| 'no-useless-constructor': 'off', | |
| 'react/react-in-jsx-scope': 'off', | |
| 'react/no-children-prop': 'off', | |
| 'space-before-function-paren': 'off', | |
| 'multiline-ternary': 'off' | |
| } | |
| } |
| module.exports = { | |
| printWidth: 85, | |
| arrowParens: 'always', | |
| semi: false, | |
| tabWidth: 2, | |
| singleQuote: true, | |
| endOfLine: 'auto', | |
| trailingComma: 'none', | |
| 'space-before-function-paren': 'never', | |
| } |
obrigado pelo código, auxiliou deveras
não funciona
achei ok, vou usar