https://github.com/kreozot/eslint-config
https://github.com/kreozot/eslint-config
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/kreozot/eslint-config
- Owner: Kreozot
- Created: 2022-02-05T07:16:18.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-06-26T21:36:39.000Z (almost 2 years ago)
- Last Synced: 2025-01-28T03:18:25.749Z (4 months ago)
- Language: JavaScript
- Size: 141 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# @kreozot/eslint-config
[](https://badge.fury.io/js/@kreozot%2Feslint-config)
Structured shareable ESLint-config with custom rules overrides for JS, TS and TS+React projects.
Based on [Airbnb JavaScript Style Guide](https://github.com/airbnb/javascript),
more specific on [TypeScript adaptation](https://www.npmjs.com/package/eslint-config-airbnb-typescript).Has autotests with precommit and prepublish hooks to ensure that all the rules are defined correctly.
## Usage with TypeScript + React
Installation with all required dependencies (including ESLint and TypeScript):
```
npm i --save-dev @kreozot/eslint-config @typescript-eslint/eslint-plugin @typescript-eslint/parser eslint typescript eslint-config-airbnb eslint-config-airbnb-typescript eslint-plugin-import eslint-plugin-jsx-a11y eslint-plugin-react eslint-plugin-react-hooks
```> Why not to add all these dependencies to package.json? Because of [ESLint restrictions](https://eslint.org/docs/developer-guide/shareable-configs#publishing-a-shareable-config).
Project ESLint configuration example:
```json
{
"extends": [
"@kreozot/eslint-config"
],
"parserOptions": {
"project": "./tsconfig.json"
}
}
```## Usage with TypeScript
Installation with all required dependencies (including ESLint):
```
npm i --save-dev @kreozot/eslint-config @typescript-eslint/eslint-plugin @typescript-eslint/parser eslint typescript eslint-config-airbnb eslint-config-airbnb-typescript eslint-plugin-import
```Project ESLint configuration example:
```json
{
"extends": [
"@kreozot/eslint-config/ts"
],
"parserOptions": {
"project": "./tsconfig.json"
}
}
```## Usage with JavaScript
Installation with all required dependencies (including ESLint):
```
npm i --save-dev @kreozot/eslint-config eslint eslint-config-airbnb-base eslint-plugin-import
```Project ESLint configuration example:
```json
{
"extends": [
"@kreozot/eslint-config/js"
],
"parserOptions": {
"project": "./tsconfig.json"
}
}
```## Project structure
* **overrides** - Common rules overrides
* **overrides-ts** - Rules overrides for TypeScript
* **overrides-react** - Rules overrides for React
* **js.js** - Config entry point for JavaScript
* **ts.js** - Config entry point for TypeScript
* **ts-react.js** - Config entry point for TypeScript + React