npm i -D prettier eslint \
eslint-config-airbnb-typescript \
eslint-config-prettier \
eslint-plugin-import \
eslint-plugin-jsx-a11y@^6.2.3 \
eslint-plugin-prettier \
eslint-plugin-react \
eslint-plugin-react-hooks
Last active
September 19, 2023 22:47
-
-
Save bilxio/a207668fbc8b0350545101bfc250e184 to your computer and use it in GitHub Desktop.
Prettier + ESLint + TS + React
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| root = true | |
| [*] | |
| charset = utf-8 | |
| trim_trailing_whitespace = false | |
| insert_final_newline = false | |
| end_of_line=lf | |
| [*.{ts,tsx,js,jsx,css,scss}] | |
| indent_style = space | |
| indent_size = 2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # don't ever lint node_modules | |
| node_modules | |
| # don't lint build output (make sure it's set to your correct build folder name) | |
| dist | |
| public | |
| # don't lint nyc coverage output | |
| coverage | |
| build |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "root": true, | |
| "parser": "@typescript-eslint/parser", | |
| "parserOptions": { | |
| "project": "./tsconfig.json", | |
| "tsconfigRootDir": "." | |
| }, | |
| "plugins": ["@typescript-eslint"], | |
| "extends": [ | |
| "plugin:prettier/recommended", | |
| "airbnb-typescript", | |
| "prettier", | |
| "prettier/@typescript-eslint", | |
| "prettier/react" | |
| ], | |
| "rules": { | |
| // Make prettier code formatting suggestions more verbose. | |
| "prettier/prettier": ["warn"], | |
| // Disable <Fragment> => <> replacement. Feel free to change | |
| "react/jsx-fragments": "off", | |
| // Disable prefer default export | |
| "import/prefer-default-export": "off" | |
| }, | |
| "overrides": [{ | |
| "files": ["**/*.tsx"], | |
| "rules": { | |
| "react/prop-types": "off", | |
| "react/jsx-props-no-spreading": "off" | |
| } | |
| }] | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| .vscode-test/ | |
| out/ | |
| dist/ | |
| test-fixtures/ | |
| node_modules/ | |
| build | |
| public | |
| server/ | |
| docs/ | |
| src/assets/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "printWidth": 80, | |
| "semi": false, | |
| "singleQuote": true, | |
| "trailingComma": "es5", | |
| "tabWidth": 2 | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "scripts": { | |
| "lint": "eslint --ext .js,.jsx,.ts,.tsx src --color", | |
| "format": "prettier --write src/**/*.{ts,tsx,scss,css,json}" | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment