Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(eslint): disable some eslint rules #229

Merged
merged 2 commits into from
Feb 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/angry-pandas-tap.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@mheob/eslint-config': patch
---

update dependencies
5 changes: 5 additions & 0 deletions .changeset/five-parrots-wink.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@mheob/eslint-config': minor
---

disable `import/order` and `sort-imports` rules because they conflicts with `perfectionist/sort-imports`
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
22.13.0
22.13.1
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,23 +27,23 @@
},
"devDependencies": {
"@changesets/cli": "^2.27.12",
"@commitlint/cli": "^19.6.1",
"@commitlint/cli": "^19.7.1",
"@cspell/dict-de-de": "^4.0.3",
"@mheob/changeset-changelog": "^3.0.1",
"@mheob/commitlint-config": "workspace:*",
"@mheob/eslint-config": "workspace:*",
"@mheob/prettier-config": "workspace:*",
"@types/node": "^22.10.10",
"@types/node": "^22.13.1",
"commitizen": "^4.3.1",
"cspell": "^8.17.2",
"cspell": "^8.17.3",
"cz-git": "^1.11.0",
"eslint": "catalog:",
"husky": "^9.1.7",
"lint-staged": "^15.4.2",
"prettier": "^3.4.2",
"lint-staged": "^15.4.3",
"prettier": "^3.5.0",
"ts-node": "^10.9.2",
"turbo": "^2.3.4",
"turbo": "^2.4.0",
"typescript": "catalog:"
},
"packageManager": "pnpm@9.15.4"
"packageManager": "pnpm@10.2.1"
}
2 changes: 1 addition & 1 deletion packages/commitlint-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"lint": "eslint src/**/*.ts --fix"
},
"devDependencies": {
"@commitlint/cli": "^19.6.1",
"@commitlint/cli": "^19.7.1",
"@mheob/eslint-config": "workspace:*",
"@mheob/tsconfig": "workspace:*",
"commitizen": "^4.3.1",
Expand Down
24 changes: 12 additions & 12 deletions packages/eslint-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@
},
"dependencies": {
"@antfu/install-pkg": "^1.0.0",
"@clack/prompts": "^0.9.1",
"@typescript-eslint/eslint-plugin": "^8.21.0",
"@typescript-eslint/parser": "^8.21.0",
"@vitest/eslint-plugin": "^1.1.25",
"eslint-config-flat-gitignore": "^1.0.0",
"@clack/prompts": "^0.10.0",
"@typescript-eslint/eslint-plugin": "^8.23.0",
"@typescript-eslint/parser": "^8.23.0",
"@vitest/eslint-plugin": "^1.1.27",
"eslint-config-flat-gitignore": "^2.0.0",
"eslint-config-next": "^15.1.6",
"eslint-config-prettier": "^10.0.1",
"eslint-flat-config-utils": "^2.0.0",
"eslint-merge-processors": "^1.0.0",
"eslint-flat-config-utils": "^2.0.1",
"eslint-merge-processors": "^2.0.0",
"eslint-plugin-antfu": "^3.0.0",
"eslint-plugin-command": "^3.0.0",
"eslint-plugin-eslint-comments": "^3.2.0",
Expand All @@ -52,7 +52,7 @@
"eslint-plugin-markdown": "^5.1.0",
"eslint-plugin-n": "^17.15.1",
"eslint-plugin-no-only-tests": "^3.3.0",
"eslint-plugin-perfectionist": "^4.7.0",
"eslint-plugin-perfectionist": "^4.8.0",
"eslint-plugin-prettier": "^5.2.3",
"eslint-plugin-toml": "^0.12.0",
"eslint-plugin-unicorn": "^56.0.1",
Expand All @@ -63,29 +63,29 @@
"mlly": "^1.7.4",
"parse-gitignore": "^2.0.0",
"picocolors": "^1.1.1",
"svelte": "^5.19.3",
"svelte": "^5.19.9",
"svelte-eslint-parser": "^0.43.0",
"toml-eslint-parser": "^0.10.0",
"yaml-eslint-parser": "^1.2.3",
"yargs": "^17.7.2"
},
"devDependencies": {
"@eslint-react/eslint-plugin": "^1.24.1",
"@eslint-react/eslint-plugin": "^1.26.2",
"@eslint/config-inspector": "^1.0.0",
"@mheob/tsconfig": "workspace:*",
"@types/yargs": "^17.0.33",
"astro-eslint-parser": "^1.2.1",
"eslint": "catalog:",
"eslint-plugin-astro": "^1.3.1",
"eslint-plugin-react-hooks": "^5.1.0",
"eslint-plugin-react-refresh": "^0.4.18",
"eslint-plugin-react-refresh": "^0.4.19",
"eslint-plugin-svelte": "^2.46.1",
"eslint-typegen": "^1.0.0",
"prettier": "catalog:",
"prettier-plugin-astro": "^0.14.1",
"rimraf": "^6.0.1",
"svelte-eslint-parser": "^0.43.0",
"tsup": "^8.3.5",
"tsup": "^8.3.6",
"tsx": "^4.19.2",
"typescript": "catalog:"
},
Expand Down
42 changes: 25 additions & 17 deletions packages/eslint-config/src/configs/disables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,24 @@ import type { TypedFlatConfigItem } from '../types';
export async function disables(): Promise<TypedFlatConfigItem[]> {
return [
{
files: [`**/scripts/${GLOB_SRC}`],
name: 'antfu/disables/scripts',
files: ['**/bin/**/*', `**/bin.${GLOB_SRC_EXT}`],
name: 'mheob/disables/bin',
rules: {
'antfu/no-import-dist': 'off',
'antfu/no-import-node-modules-by-path': 'off',
},
},
{
files: [`**/*.${GLOB_SRC_EXT}`],
name: 'mheob/disables/conflicts',
rules: {
'import/order': 'off', // conflicts with `perfectionist/sort-imports`
'sort-imports': 'off', // conflicts with `perfectionist/sort-imports`
},
},
{
files: [`**/*.config.${GLOB_SRC_EXT}`, `**/*.config.*.${GLOB_SRC_EXT}`],
name: 'mheob/disables/config-files',
rules: {
'antfu/no-top-level-await': 'off',
'no-console': 'off',
Expand All @@ -14,23 +30,22 @@ export async function disables(): Promise<TypedFlatConfigItem[]> {
},
{
files: [`**/cli/${GLOB_SRC}`, `**/cli.${GLOB_SRC_EXT}`],
name: 'antfu/disables/cli',
name: 'mheob/disables/cli',
rules: {
'antfu/no-top-level-await': 'off',
'no-console': 'off',
},
},
{
files: ['**/bin/**/*', `**/bin.${GLOB_SRC_EXT}`],
name: 'antfu/disables/bin',
files: ['**/*.js', '**/*.cjs'],
name: 'mheob/disables/cjs',
rules: {
'antfu/no-import-dist': 'off',
'antfu/no-import-node-modules-by-path': 'off',
'ts/no-require-imports': 'off',
},
},
{
files: ['**/*.d.?([cm])ts'],
name: 'antfu/disables/dts',
name: 'mheob/disables/dts',
rules: {
'eslint-comments/no-unlimited-disable': 'off',
'import/no-duplicates': 'off',
Expand All @@ -39,15 +54,8 @@ export async function disables(): Promise<TypedFlatConfigItem[]> {
},
},
{
files: ['**/*.js', '**/*.cjs'],
name: 'antfu/disables/cjs',
rules: {
'ts/no-require-imports': 'off',
},
},
{
files: [`**/*.config.${GLOB_SRC_EXT}`, `**/*.config.*.${GLOB_SRC_EXT}`],
name: 'antfu/disables/config-files',
files: [`**/scripts/${GLOB_SRC}`],
name: 'mheob/disables/scripts',
rules: {
'antfu/no-top-level-await': 'off',
'no-console': 'off',
Expand Down
1 change: 0 additions & 1 deletion packages/eslint-config/src/configs/imports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ export async function imports(): Promise<TypedFlatConfigItem[]> {
'import/no-named-default': 'error',
'import/no-self-import': 'error',
'import/no-webpack-loader-syntax': 'error',
'import/order': 'off', // Disabled because it conflicts with `perfectionist/sort-imports`
},
},
{
Expand Down
18 changes: 0 additions & 18 deletions packages/eslint-config/src/configs/javascript.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import globals from 'globals';

import { GLOB_SRC, GLOB_SRC_EXT } from '../globs';
import { pluginUnusedImports } from '../plugins';
import type { OptionsIsInEditor, OptionsOverrides, TypedFlatConfigItem } from '../types';

Expand Down Expand Up @@ -208,16 +207,6 @@ export async function javascript(
'prefer-rest-params': 'error',
'prefer-spread': 'error',
'prefer-template': 'error',
'sort-imports': [
'error',
{
allowSeparatedGroups: false,
ignoreCase: false,
ignoreDeclarationSort: true,
ignoreMemberSort: false,
memberSyntaxSortOrder: ['none', 'all', 'multiple', 'single'],
},
],

'symbol-description': 'error',
'unicode-bom': ['error', 'never'],
Expand All @@ -240,12 +229,5 @@ export async function javascript(
...overrides,
},
},
{
files: [`scripts/${GLOB_SRC}`, `cli.${GLOB_SRC_EXT}`],
name: 'mheob/javascript/disables/cli',
rules: {
'no-console': 'off',
},
},
];
}
8 changes: 0 additions & 8 deletions packages/eslint-config/src/configs/typescript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,13 +172,5 @@ export async function typescript(
'no-unused-expressions': 'off',
},
},
{
files: ['**/*.js', '**/*.cjs'],
name: 'mheob/typescript/disables/cjs',
rules: {
'ts/no-require-imports': 'off',
'ts/no-var-requires': 'off',
},
},
];
}
Loading