Skip to content

Instantly share code, notes, and snippets.

@kodiyak
Last active October 22, 2024 16:43
Show Gist options
  • Save kodiyak/410e069ce8b4b592b0cb98ac4e786132 to your computer and use it in GitHub Desktop.
Save kodiyak/410e069ce8b4b592b0cb98ac4e786132 to your computer and use it in GitHub Desktop.
Personal Eslint Config
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'
}
}

Eslint, Prettier Configuration

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 = {
printWidth: 85,
arrowParens: 'always',
semi: false,
tabWidth: 2,
singleQuote: true,
endOfLine: 'auto',
trailingComma: 'none',
'space-before-function-paren': 'never',
}
@flpsoaress
Copy link

achei ok, vou usar

@flpsoaress
Copy link

obrigado pelo código, auxiliou deveras

@flpsoaress
Copy link

não funciona

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment