From 534e821e8551a3e22fda2d15fa514f143aa7b54a Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 5 Nov 2024 05:06:37 +0000 Subject: [PATCH 1/3] chore(deps): update dependency @commencis/eslint-config to v1.4.0 --- package.json | 2 +- pnpm-lock.yaml | 18 ++++++------------ 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/package.json b/package.json index 17cf989..5e674e5 100644 --- a/package.json +++ b/package.json @@ -47,7 +47,7 @@ "devDependencies": { "@changesets/cli": "2.27.9", "@commencis/commitlint-config": "1.1.0", - "@commencis/eslint-config": "1.2.1", + "@commencis/eslint-config": "1.4.0", "@commencis/prettier-config": "1.1.0", "@commitlint/cli": "19.5.0", "@svitejs/changesets-changelog-github-compact": "1.2.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index fdbc265..f3d8065 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -15,8 +15,8 @@ importers: specifier: 1.1.0 version: 1.1.0 '@commencis/eslint-config': - specifier: 1.2.1 - version: 1.2.1(@types/eslint@9.6.1)(eslint@9.14.0(jiti@1.21.6))(prettier@3.3.3)(typescript@5.6.3) + specifier: 1.4.0 + version: 1.4.0(@types/eslint@9.6.1)(eslint@9.14.0(jiti@1.21.6))(prettier@3.3.3)(typescript@5.6.3) '@commencis/prettier-config': specifier: 1.1.0 version: 1.1.0 @@ -287,8 +287,8 @@ packages: '@commencis/commitlint-config@1.1.0': resolution: {integrity: sha512-nJdku+Y/dsTMfwoo66gnG3dg60hzMUVcQN50dkA/S4GrIDBq132nk8d/0lpqukm1Wn1swyvhvunYzJhUIBwOzg==} - '@commencis/eslint-config@1.2.1': - resolution: {integrity: sha512-fz6f/BkfbiB8bAS2ISDOMXNjUm9ClkDoOslZMgctfAzvOVJ8z9W9wsiKood37x++Gkf69PThAOVW+dzLgzenrA==} + '@commencis/eslint-config@1.4.0': + resolution: {integrity: sha512-KsynzUEWKAq0UJMOS2xxhuBTGu1tv3ZbrhxrK0gqPCGGgq19WYz4wfWgPCIhwjIMS1JIGmvvqo25J/9VrzIt2g==} peerDependencies: eslint: '>= 9.7' @@ -694,10 +694,6 @@ packages: resolution: {integrity: sha512-4Bfj15dVJdoy3RfZmmo86RK1Fwzn6SstsvK9JS+BaVKqC6QQQQyXekNaC+g+LKNgkQ+2VhGAzm6hO40AhMR3zQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@eslint/js@9.13.0': - resolution: {integrity: sha512-IFLyoY4d72Z5y/6o/BazFBezupzI/taV8sGumxTAVw3lXG9A6md1Dc34T9s1FoD/an9pJH8RHbAxsaEbBed9lA==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@eslint/js@9.14.0': resolution: {integrity: sha512-pFoEtFWCPyDOl+C6Ift+wC7Ro89otjigCf5vcuWqWgqNSQbRrpjSvdeE6ofLz4dHmyxD5f7gIdGT4+p36L6Twg==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} @@ -3348,9 +3344,9 @@ snapshots: dependencies: '@commitlint/config-conventional': 19.5.0 - '@commencis/eslint-config@1.2.1(@types/eslint@9.6.1)(eslint@9.14.0(jiti@1.21.6))(prettier@3.3.3)(typescript@5.6.3)': + '@commencis/eslint-config@1.4.0(@types/eslint@9.6.1)(eslint@9.14.0(jiti@1.21.6))(prettier@3.3.3)(typescript@5.6.3)': dependencies: - '@eslint/js': 9.13.0 + '@eslint/js': 9.14.0 '@next/eslint-plugin-next': 15.0.2 '@typescript-eslint/utils': 8.12.2(eslint@9.14.0(jiti@1.21.6))(typescript@5.6.3) eslint: 9.14.0(jiti@1.21.6) @@ -3670,8 +3666,6 @@ snapshots: transitivePeerDependencies: - supports-color - '@eslint/js@9.13.0': {} - '@eslint/js@9.14.0': {} '@eslint/object-schema@2.1.4': {} From d2be18a2c8c51174b8c6d5b5b614fd7726b5270e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mehmetcan=20Y=C4=B1lmaz?= Date: Wed, 6 Nov 2024 01:11:14 +0300 Subject: [PATCH 2/3] chore: group imports and fix eslint issues --- .changeset/khaki-rules-mate.md | 6 ++++++ .changeset/olive-hairs-hang.md | 6 ++++++ packages/eslint-config/src/configs/base.ts | 5 ++--- packages/eslint-config/src/configs/next.ts | 3 +-- packages/eslint-config/src/configs/react-native.ts | 3 +-- packages/eslint-config/src/configs/react.ts | 3 +-- packages/eslint-config/src/configs/typescript.ts | 3 +-- packages/eslint-config/src/configs/vue.ts | 3 +-- packages/eslint-config/src/plugins/jsxA11yPlugin.ts | 3 +-- packages/eslint-config/src/plugins/nextPlugin.ts | 4 ++-- packages/eslint-config/src/plugins/reactHooksPlugin.ts | 2 +- packages/eslint-config/src/plugins/reactPlugin.ts | 4 ++-- packages/eslint-plugin/src/index.ts | 3 ++- packages/eslint-plugin/src/rules/copyright-text.ts | 3 +-- 14 files changed, 28 insertions(+), 23 deletions(-) create mode 100644 .changeset/khaki-rules-mate.md create mode 100644 .changeset/olive-hairs-hang.md diff --git a/.changeset/khaki-rules-mate.md b/.changeset/khaki-rules-mate.md new file mode 100644 index 0000000..8e2d641 --- /dev/null +++ b/.changeset/khaki-rules-mate.md @@ -0,0 +1,6 @@ +--- +'@commencis/eslint-config': patch +'@commencis/eslint-plugin': patch +--- + +update dependency: @commencis/eslint-config@1.4.0 diff --git a/.changeset/olive-hairs-hang.md b/.changeset/olive-hairs-hang.md new file mode 100644 index 0000000..783eb58 --- /dev/null +++ b/.changeset/olive-hairs-hang.md @@ -0,0 +1,6 @@ +--- +'@commencis/eslint-config': patch +'@commencis/eslint-plugin': patch +--- + +fix: imports, grouping and lint issues diff --git a/packages/eslint-config/src/configs/base.ts b/packages/eslint-config/src/configs/base.ts index c75c2b0..43ec723 100644 --- a/packages/eslint-config/src/configs/base.ts +++ b/packages/eslint-config/src/configs/base.ts @@ -1,9 +1,8 @@ -import globals from 'globals'; import eslint from '@eslint/js'; - -import type { FlatConfigArray } from '@/types'; +import globals from 'globals'; import { importSortPluginConfig } from '@/plugins'; +import type { FlatConfigArray } from '@/types'; export default [ eslint.configs.recommended, diff --git a/packages/eslint-config/src/configs/next.ts b/packages/eslint-config/src/configs/next.ts index 7da1745..694ca13 100644 --- a/packages/eslint-config/src/configs/next.ts +++ b/packages/eslint-config/src/configs/next.ts @@ -2,14 +2,13 @@ import baseConfig from '@/configs/base'; import prettierConfig from '@/configs/prettier'; import typescriptConfig from '@/configs/typescript'; -import type { FlatConfigArray } from '@/types'; - import { jsxA11yPluginConfig, nextPluginConfig, reactHooksPluginConfig, reactPluginConfig, } from '@/plugins'; +import type { FlatConfigArray } from '@/types'; export default [ ...baseConfig, diff --git a/packages/eslint-config/src/configs/react-native.ts b/packages/eslint-config/src/configs/react-native.ts index e926069..119c2d3 100644 --- a/packages/eslint-config/src/configs/react-native.ts +++ b/packages/eslint-config/src/configs/react-native.ts @@ -2,13 +2,12 @@ import baseConfig from '@/configs/base'; import prettierConfig from '@/configs/prettier'; import typescriptConfig from '@/configs/typescript'; -import type { FlatConfigArray } from '@/types'; - import { jsxA11yPluginConfig, reactHooksPluginConfig, reactPluginConfig, } from '@/plugins'; +import type { FlatConfigArray } from '@/types'; export default [ ...baseConfig, diff --git a/packages/eslint-config/src/configs/react.ts b/packages/eslint-config/src/configs/react.ts index f300087..a7187b6 100644 --- a/packages/eslint-config/src/configs/react.ts +++ b/packages/eslint-config/src/configs/react.ts @@ -2,13 +2,12 @@ import baseConfig from '@/configs/base'; import prettierConfig from '@/configs/prettier'; import typescriptConfig from '@/configs/typescript'; -import type { FlatConfigArray } from '@/types'; - import { jsxA11yPluginConfig, reactHooksPluginConfig, reactPluginConfig, } from '@/plugins'; +import type { FlatConfigArray } from '@/types'; export default [ ...baseConfig, diff --git a/packages/eslint-config/src/configs/typescript.ts b/packages/eslint-config/src/configs/typescript.ts index ee58468..ada0f45 100644 --- a/packages/eslint-config/src/configs/typescript.ts +++ b/packages/eslint-config/src/configs/typescript.ts @@ -1,8 +1,7 @@ import tseslint from 'typescript-eslint'; -import type { FlatConfigArray } from '@/types'; - import { typescriptRules } from '@/rules'; +import type { FlatConfigArray } from '@/types'; export default [ ...tseslint.configs.strict, diff --git a/packages/eslint-config/src/configs/vue.ts b/packages/eslint-config/src/configs/vue.ts index 4d4c32c..ce22ae4 100644 --- a/packages/eslint-config/src/configs/vue.ts +++ b/packages/eslint-config/src/configs/vue.ts @@ -3,8 +3,7 @@ import tseslint from 'typescript-eslint'; import baseConfig from '@/configs/base'; import prettierConfig from '@/configs/prettier'; import typescriptConfig from '@/configs/typescript'; - -import type { FlatConfigArray } from '@/types'; +import { type FlatConfigArray } from '@/types'; import { vuePluginConfig } from '@/plugins'; diff --git a/packages/eslint-config/src/plugins/jsxA11yPlugin.ts b/packages/eslint-config/src/plugins/jsxA11yPlugin.ts index 36f028f..724be9d 100644 --- a/packages/eslint-config/src/plugins/jsxA11yPlugin.ts +++ b/packages/eslint-config/src/plugins/jsxA11yPlugin.ts @@ -1,8 +1,7 @@ import jsxA11yPlugin from 'eslint-plugin-jsx-a11y'; -import { FlatConfig } from '@/types'; - import { JSX_TSX_FILE_PATTERNS } from '@/constants'; +import { FlatConfig } from '@/types'; export const jsxA11yPluginConfig: FlatConfig = { name: 'commencis/plugin:jsx-a11y', diff --git a/packages/eslint-config/src/plugins/nextPlugin.ts b/packages/eslint-config/src/plugins/nextPlugin.ts index a980622..e545aa3 100644 --- a/packages/eslint-config/src/plugins/nextPlugin.ts +++ b/packages/eslint-config/src/plugins/nextPlugin.ts @@ -1,8 +1,8 @@ import nextPlugin from '@next/eslint-plugin-next'; -import { FlatConfig } from '@/types'; - import { JSX_TSX_FILE_PATTERNS } from '@/constants'; +import { type FlatConfig } from '@/types'; + import { nextPluginRules } from '@/rules'; export const nextPluginConfig: FlatConfig = { diff --git a/packages/eslint-config/src/plugins/reactHooksPlugin.ts b/packages/eslint-config/src/plugins/reactHooksPlugin.ts index 1d16b3f..e813a1e 100644 --- a/packages/eslint-config/src/plugins/reactHooksPlugin.ts +++ b/packages/eslint-config/src/plugins/reactHooksPlugin.ts @@ -1,8 +1,8 @@ import reactHooksPlugin from 'eslint-plugin-react-hooks'; +import { JSX_TSX_FILE_PATTERNS } from '@/constants'; import { FlatConfig } from '@/types'; -import { JSX_TSX_FILE_PATTERNS } from '@/constants'; import { reactHooksRules } from '@/rules'; export const reactHooksPluginConfig: FlatConfig = { diff --git a/packages/eslint-config/src/plugins/reactPlugin.ts b/packages/eslint-config/src/plugins/reactPlugin.ts index 6ea5983..825f063 100644 --- a/packages/eslint-config/src/plugins/reactPlugin.ts +++ b/packages/eslint-config/src/plugins/reactPlugin.ts @@ -1,8 +1,8 @@ import reactPlugin from 'eslint-plugin-react'; -import { FlatConfig } from '@/types'; - import { JSX_TSX_FILE_PATTERNS } from '@/constants'; +import { type FlatConfig } from '@/types'; + import { reactRules } from '@/rules'; export const reactPluginConfig: FlatConfig = { diff --git a/packages/eslint-plugin/src/index.ts b/packages/eslint-plugin/src/index.ts index 83a1601..f84f4b6 100644 --- a/packages/eslint-plugin/src/index.ts +++ b/packages/eslint-plugin/src/index.ts @@ -1,9 +1,10 @@ import type { Linter } from '@typescript-eslint/utils/ts-eslint'; +import { all, recommended } from '@/configs'; + import rules from '@/rules'; import packageJson from '../package.json'; -import { all, recommended } from './configs'; const plugin = { meta: { diff --git a/packages/eslint-plugin/src/rules/copyright-text.ts b/packages/eslint-plugin/src/rules/copyright-text.ts index acb6f92..ede347d 100644 --- a/packages/eslint-plugin/src/rules/copyright-text.ts +++ b/packages/eslint-plugin/src/rules/copyright-text.ts @@ -1,8 +1,7 @@ import { TSESTree } from '@typescript-eslint/utils'; -import { createRule, getCopyrightText } from '@/utils'; - import { DEFAULT_START_YEAR } from '@/constants'; +import { createRule, getCopyrightText } from '@/utils'; type RuleOptions = { startYear?: number; From 9a69a1c9965b4aef14d8368e86b555e0e43a9f9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mehmetcan=20Y=C4=B1lmaz?= Date: Wed, 6 Nov 2024 01:32:47 +0300 Subject: [PATCH 3/3] chore: re-arrange type imports --- packages/eslint-config/src/configs/base.ts | 3 ++- packages/eslint-config/src/configs/next.ts | 2 +- packages/eslint-config/src/configs/prettier.ts | 2 +- packages/eslint-config/src/configs/react-native.ts | 2 +- packages/eslint-config/src/configs/react.ts | 2 +- packages/eslint-config/src/configs/typescript.ts | 3 ++- packages/eslint-config/src/plugins/jsxA11yPlugin.ts | 2 +- packages/eslint-config/src/plugins/reactHooksPlugin.ts | 2 +- 8 files changed, 10 insertions(+), 8 deletions(-) diff --git a/packages/eslint-config/src/configs/base.ts b/packages/eslint-config/src/configs/base.ts index 43ec723..03cc15f 100644 --- a/packages/eslint-config/src/configs/base.ts +++ b/packages/eslint-config/src/configs/base.ts @@ -1,8 +1,9 @@ import eslint from '@eslint/js'; import globals from 'globals'; +import { type FlatConfigArray } from '@/types'; + import { importSortPluginConfig } from '@/plugins'; -import type { FlatConfigArray } from '@/types'; export default [ eslint.configs.recommended, diff --git a/packages/eslint-config/src/configs/next.ts b/packages/eslint-config/src/configs/next.ts index 694ca13..eaf173a 100644 --- a/packages/eslint-config/src/configs/next.ts +++ b/packages/eslint-config/src/configs/next.ts @@ -1,6 +1,7 @@ import baseConfig from '@/configs/base'; import prettierConfig from '@/configs/prettier'; import typescriptConfig from '@/configs/typescript'; +import { type FlatConfigArray } from '@/types'; import { jsxA11yPluginConfig, @@ -8,7 +9,6 @@ import { reactHooksPluginConfig, reactPluginConfig, } from '@/plugins'; -import type { FlatConfigArray } from '@/types'; export default [ ...baseConfig, diff --git a/packages/eslint-config/src/configs/prettier.ts b/packages/eslint-config/src/configs/prettier.ts index d61eb16..71304af 100644 --- a/packages/eslint-config/src/configs/prettier.ts +++ b/packages/eslint-config/src/configs/prettier.ts @@ -1,6 +1,6 @@ import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended'; -import type { FlatConfigArray } from '@/types'; +import { type FlatConfigArray } from '@/types'; export default [ eslintPluginPrettierRecommended, diff --git a/packages/eslint-config/src/configs/react-native.ts b/packages/eslint-config/src/configs/react-native.ts index 119c2d3..1b925c3 100644 --- a/packages/eslint-config/src/configs/react-native.ts +++ b/packages/eslint-config/src/configs/react-native.ts @@ -1,13 +1,13 @@ import baseConfig from '@/configs/base'; import prettierConfig from '@/configs/prettier'; import typescriptConfig from '@/configs/typescript'; +import { type FlatConfigArray } from '@/types'; import { jsxA11yPluginConfig, reactHooksPluginConfig, reactPluginConfig, } from '@/plugins'; -import type { FlatConfigArray } from '@/types'; export default [ ...baseConfig, diff --git a/packages/eslint-config/src/configs/react.ts b/packages/eslint-config/src/configs/react.ts index a7187b6..09d324b 100644 --- a/packages/eslint-config/src/configs/react.ts +++ b/packages/eslint-config/src/configs/react.ts @@ -1,13 +1,13 @@ import baseConfig from '@/configs/base'; import prettierConfig from '@/configs/prettier'; import typescriptConfig from '@/configs/typescript'; +import { type FlatConfigArray } from '@/types'; import { jsxA11yPluginConfig, reactHooksPluginConfig, reactPluginConfig, } from '@/plugins'; -import type { FlatConfigArray } from '@/types'; export default [ ...baseConfig, diff --git a/packages/eslint-config/src/configs/typescript.ts b/packages/eslint-config/src/configs/typescript.ts index ada0f45..16c0314 100644 --- a/packages/eslint-config/src/configs/typescript.ts +++ b/packages/eslint-config/src/configs/typescript.ts @@ -1,7 +1,8 @@ import tseslint from 'typescript-eslint'; +import { type FlatConfigArray } from '@/types'; + import { typescriptRules } from '@/rules'; -import type { FlatConfigArray } from '@/types'; export default [ ...tseslint.configs.strict, diff --git a/packages/eslint-config/src/plugins/jsxA11yPlugin.ts b/packages/eslint-config/src/plugins/jsxA11yPlugin.ts index 724be9d..dd8fb05 100644 --- a/packages/eslint-config/src/plugins/jsxA11yPlugin.ts +++ b/packages/eslint-config/src/plugins/jsxA11yPlugin.ts @@ -1,7 +1,7 @@ import jsxA11yPlugin from 'eslint-plugin-jsx-a11y'; import { JSX_TSX_FILE_PATTERNS } from '@/constants'; -import { FlatConfig } from '@/types'; +import { type FlatConfig } from '@/types'; export const jsxA11yPluginConfig: FlatConfig = { name: 'commencis/plugin:jsx-a11y', diff --git a/packages/eslint-config/src/plugins/reactHooksPlugin.ts b/packages/eslint-config/src/plugins/reactHooksPlugin.ts index e813a1e..e9d4003 100644 --- a/packages/eslint-config/src/plugins/reactHooksPlugin.ts +++ b/packages/eslint-config/src/plugins/reactHooksPlugin.ts @@ -1,7 +1,7 @@ import reactHooksPlugin from 'eslint-plugin-react-hooks'; import { JSX_TSX_FILE_PATTERNS } from '@/constants'; -import { FlatConfig } from '@/types'; +import { type FlatConfig } from '@/types'; import { reactHooksRules } from '@/rules';