-
-
Save spencerfeng/b7e2011eeb5cbcef5d47f61fe653e37e to your computer and use it in GitHub Desktop.
Prettier with TypeScript
This file contains 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
module.exports = { | |
parser: '@typescript-eslint/parser', | |
extends: [ | |
'plugin:@typescript-eslint/recommended', | |
'prettier/@typescript-eslint', | |
'plugin:prettier/recommended', | |
], | |
plugins: [ | |
"react-hooks", | |
], | |
parserOptions: { | |
ecmaVersion: 2018, | |
sourceType: 'module', | |
ecmaFeatures: { | |
jsx: true, | |
}, | |
}, | |
rules: { | |
"@typescript-eslint/array-type": "off", | |
"@typescript-eslint/explicit-function-return-type": "off", | |
"@typescript-eslint/explicit-member-accessibility": "off", | |
"@typescript-eslint/no-empty-interface": "off", | |
"@typescript-eslint/no-explicit-any": "off", | |
"@typescript-eslint/no-namespace": "off", | |
"@typescript-eslint/no-parameter-properties": "off", | |
"@typescript-eslint/prefer-interface": "off", | |
"react-hooks/rules-of-hooks": "error", | |
"react-hooks/exhaustive-deps": "error", | |
}, | |
settings: { | |
react: { | |
version: 'detect', | |
}, | |
}, | |
} |
This file contains 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
module.exports = { | |
"semi": false, | |
"useTabs": true, | |
"tabWidth": 2, | |
"printWidth": 120, | |
"singleQuote": true, | |
"trailingComma": "es5" | |
} |
This file contains 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": { | |
"eslint:lint": "eslint \"src/**/*.{ts,tsx}\" ", | |
"eslint:fix": "eslint --fix \"src/**/*.{ts,tsx}\" " | |
} | |
} |
This file contains 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
npm install @typescript-eslint/eslint-plugin @typescript-eslint/parser eslint eslint-config-prettier eslint-plugin-prettier eslint-plugin-react eslint-plugin-react-hooks prettier --save-dev |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment