Compare commits

...

3 Commits

Author SHA1 Message Date
Anthony Fu
40817389a1 chore: release v0.33.0 2022-11-30 09:04:46 +08:00
Anthony Fu
79da8986db docs: add principle note 2022-11-30 09:04:41 +08:00
Anthony Fu
1c4260a937 fix: type aware linting when trigged by tsconfig.eslint.json 2022-11-30 09:02:21 +08:00
9 changed files with 15 additions and 10 deletions

View File

@@ -6,8 +6,9 @@
- Auto fix for formatting (aimed to be used standalone without Prettier)
- Designed to work with TypeScript, Vue out-of-box
- Lint also for json, yaml, markdown
- Sorted imports, dangling commas for cleaner commit diff
- Sorted imports, dangling commas
- Reasonable defaults, best practices, only one-line of config
- **Style principle**: Minimal for reading, stable for diff
## Usage
@@ -54,6 +55,10 @@ Install [VS Code ESLint extension](https://marketplace.visualstudio.com/items?it
}
```
### TypeScript Aware Rules
Type aware rules are enabled when a `tsconfig.eslint.json` is found in the project root. Refer to [this file](https://github.com/antfu/eslint-config/blob/main/packages/typescript/index.js#L17).
## Extended Reading
Learn more about the context - [Why I don't use Prettier](https://antfu.me/posts/why-not-prettier).

View File

@@ -1,6 +1,6 @@
{
"name": "@antfu/eslint-config-monorepo",
"version": "0.32.0",
"version": "0.33.0",
"private": true,
"packageManager": "pnpm@7.1.0",
"author": "Anthony Fu <anthonyfu117@hotmail.com> (https://github.com/antfu/)",

View File

@@ -1,6 +1,6 @@
{
"name": "@antfu/eslint-config",
"version": "0.32.0",
"version": "0.33.0",
"description": "Anthony's ESLint config",
"author": "Anthony Fu <anthonyfu117@hotmail.com> (https://github.com/antfu/)",
"license": "MIT",

View File

@@ -1,6 +1,6 @@
{
"name": "@antfu/eslint-config-basic",
"version": "0.32.0",
"version": "0.33.0",
"description": "",
"author": "Anthony Fu <anthonyfu117@hotmail.com> (https://github.com/antfu/)",
"license": "MIT",

View File

@@ -1,6 +1,6 @@
{
"name": "eslint-plugin-antfu",
"version": "0.32.0",
"version": "0.33.0",
"license": "MIT",
"homepage": "https://github.com/antfu/eslint-config",
"main": "./dist/index.cjs",

View File

@@ -1,6 +1,6 @@
{
"name": "@antfu/eslint-config-react",
"version": "0.32.0",
"version": "0.33.0",
"description": "",
"author": "Anthony Fu <anthonyfu117@hotmail.com> (https://github.com/antfu/)",
"license": "MIT",

View File

@@ -14,7 +14,7 @@ module.exports = {
},
},
overrides: basic.overrides.concat(
!fs.existsSync(join(process.cwd(), 'tsconfig.json'))
!fs.existsSync(join(process.cwd(), 'tsconfig.eslint.json'))
? []
: [{
parserOptions: {
@@ -31,7 +31,7 @@ module.exports = {
'@typescript-eslint/no-implied-eval': 'error',
'dot-notation': 'off',
'@typescript-eslint/dot-notation': ['error', { allowKeywords: true }],
'no-void': ['error', { 'allowAsStatement': true }],
'no-void': ['error', { allowAsStatement: true }],
'@typescript-eslint/no-floating-promises': 'error',
'@typescript-eslint/no-misused-promises': 'error',
},

View File

@@ -1,6 +1,6 @@
{
"name": "@antfu/eslint-config-ts",
"version": "0.32.0",
"version": "0.33.0",
"description": "",
"author": "Anthony Fu <anthonyfu117@hotmail.com> (https://github.com/antfu/)",
"license": "MIT",

View File

@@ -1,6 +1,6 @@
{
"name": "@antfu/eslint-config-vue",
"version": "0.32.0",
"version": "0.33.0",
"description": "",
"author": "Anthony Fu <anthonyfu117@hotmail.com> (https://github.com/antfu/)",
"license": "MIT",