Skip to content

Instantly share code, notes, and snippets.

@washingtonsoares
Created July 18, 2021 21:49
Show Gist options
  • Select an option

  • Save washingtonsoares/b1164c4ddfe67afb88bbbf4be221ef2b to your computer and use it in GitHub Desktop.

Select an option

Save washingtonsoares/b1164c4ddfe67afb88bbbf4be221ef2b to your computer and use it in GitHub Desktop.
Eslint + Prettier
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2020,
sourceType: 'module',
ecmaFeatures: {
jsx: true
}
},
settings: {
react: {
version: 'detect'
}
},
extends: [
'plugin:react/recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:react-hooks/recommended',
'plugin:prettier/recommended'
],
plugins: ['react-hooks', '@typescript-eslint', 'prettier'],
rules: {
'react/react-in-jsx-scope': 'off',
'react/jsx-filename-extension': [1, { extensions: ['.ts', '.tsx'] }],
'import/no-named-as-default': 0,
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn',
'prettier/prettier': ['error', { singleQuote: true }],
'@typescript-eslint/explicit-member-accessibility': 0,
'@typescript-eslint/explicit-function-return-type': 0,
'@typescript-eslint/no-explicit-any': 1,
'@typescript-eslint/explicit-module-boundary-types': 'off'
}
};
yarn add eslint prettier eslint-plugin-react-hooks @typescript-eslint/parser @typescript-eslint/eslint-plugin eslint-plugin-react eslint-config-prettier eslint-plugin-prettier --dev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment