eslint-config-justinneff-ts
v3.1.0
Published
ESLint and Prettier configs for Typescript by Justin Neff
Downloads
6
Readme
ESLint and Prettier Presets for Typescript
These are the ESLint and Prettier settings I like to use for Typescript projects.
Installing
- Ensure you have
package.json
file - Install
eslint-config-justinneff-ts
and it's peer dependencies. (This command works with yarn too)
npx install-peerdeps -D eslint-config-justinneff-ts
- Create a
.eslintrc
file in the root of your project that looks like this:
{
"extends": ["justinneff-ts"]
}
- Create a
.prettierrc
file in the root of your project. These are the default settings I use:
{
"arrowParens": "always",
"bracketSpacing": true,
"jsxSingleQuote": false,
"semi": false,
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "all",
"useTabs": true
}
- You can also add these scripts to the
package.json
file to give you simple commands for linting and fixing files.
"scripts": {
"lint": "eslint .",
"lint:fix": "eslint . --fix"
},