https://github.com/axiscommunications/eslint-config-typescript-shareable
Typescript ESLint shareable config (ESLint, stylelint, Prettier)
https://github.com/axiscommunications/eslint-config-typescript-shareable
Last synced: about 1 year ago
JSON representation
Typescript ESLint shareable config (ESLint, stylelint, Prettier)
- Host: GitHub
- URL: https://github.com/axiscommunications/eslint-config-typescript-shareable
- Owner: AxisCommunications
- License: mit
- Created: 2020-04-06T09:22:27.000Z (over 6 years ago)
- Default Branch: main
- Last Pushed: 2023-07-14T09:40:54.000Z (about 3 years ago)
- Last Synced: 2025-06-18T13:54:29.270Z (about 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 34.8 MB
- Stars: 11
- Watchers: 2
- Forks: 5
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Codeowners: CODEOWNERS
Awesome Lists containing this project
README
# eslint-config-typescript-shareable
Typescript ESLint shareable config
This config provides an explicit list of linting rules so you can use the same rules across different projects.
The rules that are provided in this config are mostly best practices for the React and JavaScript and TypeScript code.
This configuration presumes that at least ES2015, TypeScript and [React strict mode](https://reactjs.org/docs/strict-mode.html)
are used in the project that uses this config.
The rules we have should:
- not enforce any visual style (use prettier for that)
- not enforce any particular coding style (functional, React hooks)
- be well-behaved (e.g. forcing use of nullish coalescing can lead to worse looking code)
- be allowed or error, not just warn
If you want to add a new rule or change an existing rule, please create an issue or pull request.
## Install
```bash
yarn add -D eslint-config-typescript-shareable
```
## Usage
1. ESLint
Add to your `eslintrc.yaml` configuration file:
```yml
extends:
- 'typescript-shareable'
parserOptions:
project: './tsconfig.json'
env:
browser: true
es6: true
node: true
overrides:
###
# Test file overrides
###
- files: ['**/*.test.tsx', '**/*.test.ts']
env:
jest: true
```
2. stylelint
Add to your `.stylelintrc` configuration file:
```json
{
"extends": ["eslint-config-typescript-shareable/.stylelintrc"]
}
```
3. Prettier
Add to your `.prettierrc.js` configuration file:
```js
module.exports = {
...require('eslint-config-typescript-shareable/.prettierrc.js'),
}
```