Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
NextJS / React ESLINT + TS + PRETTIER SETUP
// .eslintrc.js
module.exports = {
parser: '@typescript-eslint/parser',
extends: [
'plugin:@typescript-eslint/recommended',
'prettier/@typescript-eslint',
'react-app',
'plugin:prettier/recommended',
],
plugins: ['@typescript-eslint', 'react'],
rules: {},
};
// .prettierrc.js
module.exports = {
useTabs: false,
printWidth: 80,
singleQuote: true,
trailingComma: 'es5',
jsxBracketSameLine: true,
noSemi: false
};
// Dev dependencies in package.json
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^1.13.0",
"@typescript-eslint/parser": "^1.13.0",
"babel-eslint": "^10.0.2",
"eslint": "^5.16.0",
"eslint-config-prettier": "^6.0.0",
"eslint-config-react-app": "^4.0.1",
"eslint-plugin-flowtype": "^2",
"eslint-plugin-import": "^2.18.2",
"eslint-plugin-jsx-a11y": "^6.2.3",
"eslint-plugin-prettier": "^3.1.0",
"eslint-plugin-react": "^7.14.3",
"eslint-plugin-react-hooks": "^1.6.1",
"prettier": "^1.18.2",
"typescript": "^3.5.3",
"webpack": "^4.38.0"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.