Skip to content

Instantly share code, notes, and snippets.

@zaknesler
Last active May 27, 2023 00:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zaknesler/1bdac2632632ebb09297c4ffff61506a to your computer and use it in GitHub Desktop.
Save zaknesler/1bdac2632632ebb09297c4ffff61506a to your computer and use it in GitHub Desktop.
react/eslint/prettier/typescript/tailwind
!.src
!*.{js,jsx,ts,tsx,cjs,mjs,html}
module.exports = {
root: true,
env: { node: true, browser: true, es6: true, commonjs: true },
parser: '@typescript-eslint/parser',
parserOptions: {
tsconfigRootDir: __dirname,
ecmaFeatures: { jsx: true },
ecmaVersion: 'latest',
sourceType: 'module',
},
extends: [
'prettier',
'plugin:import/recommended',
'plugin:@typescript-eslint/recommended',
'plugin:react-hooks/recommended',
],
plugins: ['react', 'prettier', '@typescript-eslint', 'react-refresh'],
rules: {
'react-refresh/only-export-components': 'warn',
'import/default': 'error',
'import/named': 'error',
'import/newline-after-import': ['error', { count: 1 }],
'import/no-unresolved': 'error',
'import/order': [
'error',
{
groups: [
['external', 'builtin'],
['internal', 'parent', 'index'],
'sibling',
],
alphabetize: { order: 'asc', caseInsensitive: true },
},
],
'no-nested-ternary': 0,
'no-underscore-dangle': 0,
'no-unused-vars': 'off',
'react/no-unknown-property': 'warn',
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
'prettier/prettier': [
'error',
{
printWidth: 80,
arrowParens: 'avoid',
semi: false,
singleQuote: true,
tabWidth: 2,
trailingComma: 'all',
endOfLine: 'lf',
},
],
},
settings: {
'import/parsers': {
'@typescript-eslint/parser': ['.ts', '.tsx'],
},
'import/resolver': {
typescript: {},
},
},
}
{
"devDependencies": {
"@types/react-dom": "latest",
"@types/react": "latest",
"@typescript-eslint/eslint-plugin": "latest",
"@typescript-eslint/parser": "latest",
"autoprefixer": "latest",
"eslint": "latest",
"eslint-config-prettier": "latest",
"eslint-import-resolver-typescript": "latest",
"eslint-plugin-import": "latest",
"eslint-plugin-prettier": "latest",
"eslint-plugin-react-hooks": "latest",
"eslint-plugin-react-refresh": "latest",
"eslint-plugin-react": "latest",
"prettier-plugin-tailwindcss": "latest",
"prettier": "latest",
"tailwindcss": "latest",
"typescript": "latest",
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment