Skip to content

Instantly share code, notes, and snippets.

@JirkaVebr
Created January 17, 2020 15:11
Show Gist options
  • Save JirkaVebr/519c7597517e4ba756d5b89e7cb4cc0e to your computer and use it in GitHub Desktop.
Save JirkaVebr/519c7597517e4ba756d5b89e7cb4cc0e to your computer and use it in GitHub Desktop.
Prettier with TypeScript
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',
},
},
}
module.exports = {
"semi": false,
"useTabs": true,
"tabWidth": 2,
"printWidth": 120,
"singleQuote": true,
"trailingComma": "es5"
}
{
"scripts": {
"eslint:lint": "eslint \"src/**/*.{ts,tsx}\" ",
"eslint:fix": "eslint --fix \"src/**/*.{ts,tsx}\" "
}
}
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
@swyxio
Copy link

swyxio commented Jan 17, 2020

you had me until useTabs :trollface:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment