Skip to content

Instantly share code, notes, and snippets.

@mszczepanczyk
Created November 18, 2021 14:42
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 mszczepanczyk/616c75bd4f84adeadd136ef4551d9f13 to your computer and use it in GitHub Desktop.
Save mszczepanczyk/616c75bd4f84adeadd136ef4551d9f13 to your computer and use it in GitHub Desktop.
eslint
module.exports = {
extends: [
'airbnb-typescript',
'airbnb/hooks',
'plugin:@typescript-eslint/recommended',
'prettier',
],
parser: '@typescript-eslint/parser',
parserOptions: {
project: './tsconfig.json',
sourceType: 'module',
},
plugins: ['@typescript-eslint', 'simple-import-sort', 'import', 'prettier', 'react'],
rules: {
'@typescript-eslint/ban-types': 'off',
'@typescript-eslint/default-param-last': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/no-empty-interface': 'off',
'@typescript-eslint/no-redeclare': 'off',
'class-methods-use-this': 'off',
'import/no-default-export': 'error',
'import/no-extraneous-dependencies': 'off',
'import/prefer-default-export': 'off',
"import/first": "error",
"import/newline-after-import": "error",
"import/no-duplicates": "error",
'jsx-quotes': ['error', 'prefer-single'],
'no-unused-vars': 'warn',
'max-classes-per-file': 'off',
'prettier/prettier': [
'error',
{
jsxSingleQuote: true,
printWidth: 120,
singleQuote: true,
tabWidth: 2,
trailingComma: 'all',
},
],
'react/require-default-props': 'off',
'react/self-closing-comp': 'error',
'simple-import-sort/exports': 'error',
'simple-import-sort/imports': 'error',
},
overrides: [
{
files: '*.js',
rules: {
'@typescript-eslint/no-var-requires': 'off',
},
},
{
files: '*.d.ts',
rules: {
'import/no-default-export': 'off',
},
},
{
files: '*.stories.tsx',
rules: {
'import/no-default-export': 'off',
},
},
],
};
{
"scripts": {
"lint": "eslint --fix src"
},
"devDependencies": {
"eslint-config-airbnb": "^18.2.1",
"eslint-config-airbnb-typescript": "^14.0.1",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-import": "^2.25.2",
"eslint-plugin-jsx-a11y": "^6.4.1",
"eslint-plugin-prettier": "^3.4.1",
"eslint-plugin-react": "^7.26.1",
"eslint-plugin-react-hooks": "^4.2.0",
"eslint-plugin-simple-import-sort": "^7.0.0",
"prettier": "^2.4.1"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment