https://github.com/lazycuh/eslint-config-base
Base ESLint rules that work well for any Typescript projects
https://github.com/lazycuh/eslint-config-base
eslint eslint-config eslint-node eslint-node-typescript eslint-typescript eslint-typescript-javascript
Last synced: 29 days ago
JSON representation
Base ESLint rules that work well for any Typescript projects
- Host: GitHub
- URL: https://github.com/lazycuh/eslint-config-base
- Owner: lazycuh
- Created: 2023-11-10T04:55:36.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-12-08T01:54:09.000Z (6 months ago)
- Last Synced: 2025-04-20T13:18:54.731Z (about 1 month ago)
- Topics: eslint, eslint-config, eslint-node, eslint-node-typescript, eslint-typescript, eslint-typescript-javascript
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/@lazycuh/eslint-config-base
- Size: 190 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
Awesome Lists containing this project
README
# eslint-config-base [](https://app.circleci.com/pipelines/github/lazycuh/eslint-config-base?branch=main)
Base ESLint rules that work well for any Typescript projects.
## ESLint compatibility
| This library | ESLint |
| ------------ | ------ |
| 2.x.x | ^9 |
| 1.x.x | ^8 |## Installation
- `npm`
```
npm i -S @lazycuh/eslint-config-base
```
- `pnpm`
```
pnpm i -S @lazycuh/eslint-config-base
```
- `yarn````
yarn add @lazycuh/eslint-config-base
```## Setting up
### ESLint 9
`eslint.config.js` file
```js
const eslintConfigBase = require('@lazycuh/eslint-config-base');/**
* @type {import('eslint').Linter.FlatConfig[]}
*/
module.exports = [
...eslintConfigBase.map(config => ({
...config,files: ['src/**/*.ts'], // Only lint Typescript files under `src` directory.
rules: {
...config.rules
// Your rule overrides go here
}
}))
];
```_If your `package.json` file has `"type": "module"`, you can change the above `require` and `module.exports` to `import` and `export default` respectively_.
### ESLint 8
`.eslintrc.json` file
```json
{
"$schema": "https://json.schemastore.org/eslintrc.json",
"root": true,
"ignorePatterns": ["!**/*"],
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
// It's recommended to use an override to not globally change your ESLint configuration.
"overrides": [
{
"files": ["*.ts"],
"extends": ["@lazycuh/eslint-config-base"],
"rules": {
// Add your own rule overrides if desired.
}
}
]
}
```