Skip to content

Commit

Permalink
chore(package.json): update package.json to include "type" field as "…
Browse files Browse the repository at this point in the history
…module" for ES module support

chore(package.json): rearrange scripts in package.json for better readability

fix(ignore.ts): remove trailing whitespace and fix JSDoc comment formatting

fix(import.ts): fix JSDoc comment formatting and disable eslint rule for ts-ignore

fix(javascript.ts): fix JSDoc comment formatting

fix(jsdoc.ts): fix JSDoc comment formatting

fix(jsonc.ts): remove trailing whitespace

fix(node.ts): fix JSDoc comment formatting

fix(package-json.ts): fix JSDoc comment formatting

fix(stylistic.ts): fix JSDoc comment formatting and disable eslint rule for ts-ignore

fix(test.ts): fix JSDoc comment formatting

fix(typescript.ts): fix JSDoc comment formatting

fix(unicorn.ts): fix JSDoc comment formatting

chore(eslint): update eslint configuration

- Change single quotes to double quotes for consistency
- Update indentation to use 2 spaces
- Remove trailing spaces
- Remove unused rules
- Add missing rules
- Update rule options to follow conventions
- Update TypeScript parser options
- Update TypeScript compiler options
- Update tsconfig.json file

fix(utils/glob.ts): add missing newline at the end of the file

fix(utils/plugin.ts): add ts-nocheck comment to disable TypeScript checking for the file

fix(utils/type.ts): add missing newline at the end of the file

fix(utils/util.ts): add missing newline at the end of the file

The changes were made to improve the code quality and maintainability of the project. The eslint configuration was updated to enforce consistent coding style and catch potential issues. The TypeScript parser and compiler options were also updated to align with the project requirements.
  • Loading branch information
Bluzzi committed Nov 8, 2023
1 parent c7d8fd7 commit 69aa2d0
Show file tree
Hide file tree
Showing 19 changed files with 140 additions and 138 deletions.
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
{
"name": "@bluzzi/eslint-config",
"type": "module",
"version": "1.2.1",
"author": "Bluzzi",
"type": "module",
"scripts": {
"build": "tsup src/index.ts --minify --format cjs,esm --clean --dts",
"lint": "eslint .",
"lint:fix": "eslint . --fix",
"ts:check": "tsc --noEmit"
},
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"exports": {
".": {
"import": "./dist/index.js",
"require": "./dist/index.cjs"
}
},
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"scripts": {
"build": "tsup src/index.ts --minify --format cjs,esm --clean --dts",
"lint": "eslint .",
"lint:fix": "eslint . --fix",
"ts:check": "tsc --noEmit"
},
"peerDependencies": {
"eslint": ">=8.0.0"
},
Expand Down
4 changes: 2 additions & 2 deletions src/configs/ignore.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* @see {@link https://github.com/antfu/eslint-config/blob/main/src/configs/ignores.ts#L7}
**/
*/

import type { ConfigItem } from '#/utils/type'
import { GLOB_EXCLUDE } from '#/utils/glob'
Expand All @@ -11,4 +11,4 @@ export function ignores(): ConfigItem[] {
ignores: GLOB_EXCLUDE,
},
]
}
}
7 changes: 4 additions & 3 deletions src/configs/import.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* @see {@link https://github.com/antfu/eslint-config/blob/main/src/configs/imports.ts}
**/
*/

import type { ConfigItem, OptionsStylistic } from '#/utils/type'
import { pluginAntfu, pluginImport } from '#/utils/plugin'
Expand All @@ -17,7 +17,8 @@ export function imports(options: OptionsStylistic = {}): ConfigItem[] {
antfu: pluginAntfu,
import: pluginImport,
},
// @ts-ignore
// eslint-disable-next-line ts/ban-ts-comment
// @ts-expect-error
rules: {
'antfu/import-dedupe': 'error',
'antfu/no-import-node-modules-by-path': 'error',
Expand All @@ -38,4 +39,4 @@ export function imports(options: OptionsStylistic = {}): ConfigItem[] {
},
},
]
}
}
4 changes: 2 additions & 2 deletions src/configs/javascript.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* @see {@link https://github.com/antfu/eslint-config/blob/main/src/configs/javascript.ts}
**/
*/

import globals from 'globals'
import type { ConfigItem, OptionsIsInEditor, OptionsOverrides } from '#/utils/type'
Expand Down Expand Up @@ -226,4 +226,4 @@ export function javascript(options: OptionsIsInEditor & OptionsOverrides = {}):
},
},
]
}
}
4 changes: 2 additions & 2 deletions src/configs/jsdoc.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* @see {@link https://github.com/antfu/eslint-config/blob/main/src/configs/jsdoc.ts}
**/
*/

import type { ConfigItem, OptionsStylistic } from '#/utils/type'
import { pluginJsdoc } from '#/utils/plugin'
Expand Down Expand Up @@ -42,4 +42,4 @@ export function jsdoc(options: OptionsStylistic = {}): ConfigItem[] {
},
},
]
}
}
2 changes: 1 addition & 1 deletion src/configs/jsonc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,4 @@ export function jsonc(options: OptionsStylistic & OptionsOverrides = {}): Config
},
},
]
}
}
4 changes: 2 additions & 2 deletions src/configs/node.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* @see {@link https://github.com/antfu/eslint-config/blob/main/src/configs/node.ts}
**/
*/

import type { ConfigItem } from '#/utils/type'
import { pluginNode } from '#/utils/plugin'
Expand All @@ -24,4 +24,4 @@ export function node(): ConfigItem[] {
},
},
]
}
}
4 changes: 2 additions & 2 deletions src/configs/package-json.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* @see {@link https://github.com/antfu/eslint-config/blob/main/src/configs/sort.ts}
**/
*/

import type { ConfigItem } from '#/utils/type'

Expand Down Expand Up @@ -228,4 +228,4 @@ export function sortTsconfig(): ConfigItem[] {
},
},
]
}
}
7 changes: 4 additions & 3 deletions src/configs/stylistic.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* @see {@link https://github.com/antfu/eslint-config/blob/main/src/configs/stylistic.ts}
**/
*/

import type { ConfigItem, StylisticConfig } from '#/utils/type'
import { pluginAntfu, pluginStylistic } from '#/utils/plugin'
Expand All @@ -19,7 +19,8 @@ export function stylistic(options: StylisticConfig = {}): ConfigItem[] {
antfu: pluginAntfu,
style: pluginStylistic,
},
// @ts-ignore
// eslint-disable-next-line ts/ban-ts-comment
// @ts-expect-error
rules: {
'antfu/consistent-list-newline': 'error',
'antfu/if-newline': 'error',
Expand Down Expand Up @@ -169,4 +170,4 @@ export function stylistic(options: StylisticConfig = {}): ConfigItem[] {
},
},
]
}
}
4 changes: 2 additions & 2 deletions src/configs/test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* @see {@link https://github.com/antfu/eslint-config/blob/main/src/configs/test.ts}
**/
*/

import type { ConfigItem, OptionsIsInEditor, OptionsOverrides } from '#/utils/type'
import { pluginNoOnlyTests, pluginVitest } from '#/utils/plugin'
Expand Down Expand Up @@ -40,4 +40,4 @@ export function test(options: OptionsIsInEditor & OptionsOverrides = {}): Config
},
},
]
}
}
4 changes: 2 additions & 2 deletions src/configs/typescript.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* @see {@link https://github.com/antfu/eslint-config/blob/main/src/configs/typescript.ts}
**/
*/

import process from 'node:process'
import type { ConfigItem, OptionsComponentExts, OptionsOverrides, OptionsTypeScriptParserOptions, OptionsTypeScriptWithTypes } from '#/utils/type'
Expand Down Expand Up @@ -147,4 +147,4 @@ export function typescript(
},
},
]
}
}
4 changes: 2 additions & 2 deletions src/configs/unicorn.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* @see {@link https://github.com/antfu/eslint-config/blob/main/src/configs/unicorn.ts}
**/
*/

import type { ConfigItem } from '#/utils/type'
import { pluginUnicorn } from '#/utils/plugin'
Expand Down Expand Up @@ -42,4 +42,4 @@ export function unicorn(): ConfigItem[] {
},
},
]
}
}
Loading

0 comments on commit 69aa2d0

Please sign in to comment.