Skip to content

Commit

Permalink
⬆️ Upgrade to ts eslint v8 beta
Browse files Browse the repository at this point in the history
  • Loading branch information
dethdkn committed Jul 24, 2024
1 parent 2d90038 commit ec9d967
Show file tree
Hide file tree
Showing 27 changed files with 441 additions and 328 deletions.
22 changes: 11 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@dethdkn/eslint-config",
"type": "module",
"version": "1.4.10",
"version": "1.5.0",
"packageManager": "[email protected]",
"description": "🧹 My Opinionated ESLint Config",
"author": {
Expand Down Expand Up @@ -43,41 +43,41 @@
"@intlify/eslint-plugin-vue-i18n": "3.0.0",
"@nuxt/eslint-plugin": "0.3.13",
"@stylistic/eslint-plugin": "^2.3.0",
"@typescript-eslint/eslint-plugin": "^7.16.1",
"@typescript-eslint/parser": "^7.16.1",
"@typescript-eslint/parser": "8.0.0-alpha.53",
"eslint": "^9.7.0",
"eslint-import-resolver-typescript": "^3.6.1",
"eslint-plugin-antfu": "^2.3.4",
"eslint-plugin-css": "^0.10.0",
"eslint-plugin-eslint-comments": "^3.2.0",
"eslint-plugin-import-x": "^3.0.1",
"eslint-plugin-jsdoc": "^48.7.0",
"eslint-plugin-import-x": "^3.1.0",
"eslint-plugin-jsdoc": "^48.8.3",
"eslint-plugin-jsonc": "^2.16.0",
"eslint-plugin-n": "^17.9.0",
"eslint-plugin-no-only-tests": "^3.1.0",
"eslint-plugin-perfectionist": "^2.11.0",
"eslint-plugin-promise": "^6.4.0",
"eslint-plugin-perfectionist": "^3.0.0",
"eslint-plugin-promise": "^7.0.0",
"eslint-plugin-regexp": "^2.6.0",
"eslint-plugin-security": "^3.0.1",
"eslint-plugin-tailwindcss": "^3.17.4",
"eslint-plugin-toml": "^0.11.1",
"eslint-plugin-unicorn": "^54.0.0",
"eslint-plugin-unused-imports": "^4.0.0",
"eslint-plugin-unused-imports": "^4.0.1",
"eslint-plugin-vitest": "^0.5.4",
"eslint-plugin-vue": "^9.27.0",
"eslint-plugin-vuejs-accessibility": "^2.4.0",
"eslint-plugin-vuejs-accessibility": "^2.4.1",
"eslint-plugin-yml": "^1.14.0",
"jsonc-eslint-parser": "^2.4.0",
"toml-eslint-parser": "^0.10.0",
"typescript-eslint": "8.0.0-alpha.53",
"vue-eslint-parser": "^9.4.3",
"yaml-eslint-parser": "^1.2.3"
},
"devDependencies": {
"@eslint/config-inspector": "^0.5.2",
"@types/node": "^20.14.11",
"@types/node": "^20.14.12",
"tailwindcss": "^3.4.6",
"terser": "^5.31.3",
"typescript": "^5.5.3",
"typescript": "^5.5.4",
"vue": "^3.4.33"
}
}
698 changes: 393 additions & 305 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import type { Linter } from 'eslint'

import jsonParser from './parsers/json.js'
import tomlParser from './parsers/toml.js'
import tsParser from './parsers/typescript.js'
Expand Down Expand Up @@ -28,7 +30,6 @@ import unusedImports from './rules/unused-imports.js'
import vitest from './rules/vitest.js'
import vue from './rules/vue.js'
import yaml from './rules/yaml.js'
import type { Linter } from 'eslint'

export default (opts?: { tailwind?: boolean, nuxt?: boolean, i18n?: boolean }) => {
const hasTailwind = opts?.tailwind !== false
Expand Down
5 changes: 3 additions & 2 deletions src/rules/accessibility.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { Linter } from 'eslint'

import accessibility from 'eslint-plugin-vuejs-accessibility'

export default {
Expand Down Expand Up @@ -56,11 +57,11 @@ export default {
] }],
'accessibility/mouse-events-have-key-events': ['warn'],
'accessibility/no-access-key': ['warn'],
// 'accessibility/no-aria-hidden-on-focusable': ['warn'],
'accessibility/no-aria-hidden-on-focusable': ['warn'],
'accessibility/no-autofocus': ['warn'],
'accessibility/no-distracting-elements': ['warn'],
'accessibility/no-redundant-roles': ['warn'],
// 'accessibility/no-role-presentation-on-focusable': ['warn'],
'accessibility/no-role-presentation-on-focusable': ['warn'],
'accessibility/no-static-element-interactions': ['warn'],
'accessibility/role-has-required-aria-props': ['warn'],
'accessibility/tabindex-no-positive': ['warn'],
Expand Down
1 change: 1 addition & 0 deletions src/rules/antfu.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { Linter } from 'eslint'

import antfu from 'eslint-plugin-antfu'

export default {
Expand Down
1 change: 1 addition & 0 deletions src/rules/css.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { Linter } from 'eslint'

import css from 'eslint-plugin-css'

export default {
Expand Down
1 change: 1 addition & 0 deletions src/rules/eslint-comments.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { Linter } from 'eslint'

import eslintComments from 'eslint-plugin-eslint-comments'

export default {
Expand Down
3 changes: 2 additions & 1 deletion src/rules/i18n.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import i18n from '@intlify/eslint-plugin-vue-i18n'
import type { Linter } from 'eslint'

import i18n from '@intlify/eslint-plugin-vue-i18n'

export default (hasI18n: boolean): Linter.FlatConfig => {
const val = hasI18n ? 'error' : 'off'
return {
Expand Down
1 change: 1 addition & 0 deletions src/rules/importx.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { Linter } from 'eslint'

import * as importx from 'eslint-plugin-import-x'

export default {
Expand Down
1 change: 1 addition & 0 deletions src/rules/javascript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export default (nuxt: boolean): Linter.FlatConfig => ({
'no-import-assign': ['error'],
'no-inner-declarations': ['error', 'both'],
'no-irregular-whitespace': ['error'],
'no-loss-of-precision': ['error'],
'no-misleading-character-class': ['error'],
'no-new-native-nonconstructor': ['error'],
'no-obj-calls': ['error'],
Expand Down
1 change: 1 addition & 0 deletions src/rules/jsdoc.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { Linter } from 'eslint'

import jsdoc from 'eslint-plugin-jsdoc'

export default {
Expand Down
1 change: 1 addition & 0 deletions src/rules/json.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { Linter } from 'eslint'

import json from 'eslint-plugin-jsonc'

export default [
Expand Down
1 change: 1 addition & 0 deletions src/rules/node.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { Linter } from 'eslint'

import node from 'eslint-plugin-n'

export default {
Expand Down
3 changes: 2 additions & 1 deletion src/rules/nuxt.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import nuxt from '@nuxt/eslint-plugin'
import type { Linter } from 'eslint'

import nuxt from '@nuxt/eslint-plugin'

export default {
name: 'dethdkn/nuxt/rules',
plugins: { nuxt },
Expand Down
1 change: 1 addition & 0 deletions src/rules/perfectionist.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { Linter } from 'eslint'

import perfectionist from 'eslint-plugin-perfectionist'

export default {
Expand Down
4 changes: 2 additions & 2 deletions src/rules/promise.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { Linter } from 'eslint'

import promise from 'eslint-plugin-promise'

export default {
Expand All @@ -7,8 +8,7 @@ export default {
rules: {
'promise/always-return': ['error'],
'promise/catch-or-return': ['error'],
// https://github.com/eslint-community/eslint-plugin-promise/issues/472
// 'promise/no-multiple-resolved': ['error'],
'promise/no-multiple-resolved': ['error'],
'promise/no-nesting': ['error'],
'promise/no-new-statics': ['error'],
'promise/no-promise-in-callback': ['error'],
Expand Down
1 change: 1 addition & 0 deletions src/rules/regexp.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { Linter } from 'eslint'

import regexp from 'eslint-plugin-regexp'

export default {
Expand Down
1 change: 1 addition & 0 deletions src/rules/security.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { Linter } from 'eslint'

import security from 'eslint-plugin-security'

export default {
Expand Down
3 changes: 2 additions & 1 deletion src/rules/stylistic.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import stylistic from '@stylistic/eslint-plugin'
import type { Linter } from 'eslint'

import stylistic from '@stylistic/eslint-plugin'

export default {
name: 'dethdkn/stylistic/rules',
plugins: { stylistic },
Expand Down
1 change: 1 addition & 0 deletions src/rules/tailwind.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { Linter } from 'eslint'

import tailwind from 'eslint-plugin-tailwindcss'

export default {
Expand Down
1 change: 1 addition & 0 deletions src/rules/toml.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { Linter } from 'eslint'

import toml from 'eslint-plugin-toml'

export default {
Expand Down
10 changes: 6 additions & 4 deletions src/rules/typescript.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import typescript from '@typescript-eslint/eslint-plugin'
import type { Linter } from 'eslint'

import { plugin } from 'typescript-eslint'

export default (nuxt: boolean): Linter.FlatConfig => ({
name: 'dethdkn/typescript/rules',
// @ts-ignore - This is a valid value
plugins: { typescript },
plugins: { typescript: plugin },
rules: {
'typescript/array-type': ['error'],
'typescript/ban-ts-comment': ['error', { 'ts-ignore': 'allow-with-description' }],
'typescript/ban-types': ['error'],
'typescript/class-literal-property-style': ['error'],
'typescript/consistent-generic-constructors': ['error'],
'typescript/consistent-indexed-object-style': ['error'],
Expand All @@ -18,12 +18,12 @@ export default (nuxt: boolean): Linter.FlatConfig => ({
'typescript/no-array-constructor': ['error'],
'typescript/no-duplicate-enum-values': ['error'],
'typescript/no-dynamic-delete': ['error'],
'typescript/no-empty-object-type': ['error'],
'typescript/no-explicit-any': ['error'],
'typescript/no-extra-non-null-assertion': ['error'],
'typescript/no-extraneous-class': ['error'],
'typescript/no-inferrable-types': ['error'],
'typescript/no-invalid-void-type': ['error'],
'typescript/no-loss-of-precision': ['error'],
'typescript/no-misused-new': ['error'],
'typescript/no-namespace': ['error'],
'typescript/no-non-null-asserted-nullish-coalescing': ['error'],
Expand All @@ -33,8 +33,10 @@ export default (nuxt: boolean): Linter.FlatConfig => ({
'typescript/no-this-alias': ['error'],
'typescript/no-unnecessary-type-constraint': ['error'],
'typescript/no-unsafe-declaration-merging': ['error'],
'typescript/no-unsafe-function-type': ['error'],
'typescript/no-use-before-define': [nuxt ? 'off' : 'error', { classes: false, functions: false, variables: true }],
'typescript/no-useless-constructor': ['error'],
'typescript/no-wrapper-object-types': ['error'],
'typescript/prefer-as-const': ['error'],
'typescript/prefer-function-type': ['error'],
'typescript/prefer-literal-enum-member': ['error'],
Expand Down
1 change: 1 addition & 0 deletions src/rules/unicorn.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { Linter } from 'eslint'

import unicorn from 'eslint-plugin-unicorn'

export default (nuxt: boolean): Linter.FlatConfig[] => [
Expand Down
1 change: 1 addition & 0 deletions src/rules/unused-imports.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { Linter } from 'eslint'

import unusedImports from 'eslint-plugin-unused-imports'

export default {
Expand Down
1 change: 1 addition & 0 deletions src/rules/vitest.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { Linter } from 'eslint'

import onlyTest from 'eslint-plugin-no-only-tests'
import vitest from 'eslint-plugin-vitest'

Expand Down
1 change: 1 addition & 0 deletions src/rules/vue.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { Linter } from 'eslint'

import vue from 'eslint-plugin-vue'

export default (tailwind: boolean, nuxt: boolean, i18n: boolean): Linter.FlatConfig => ({
Expand Down
1 change: 1 addition & 0 deletions src/rules/yaml.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { Linter } from 'eslint'

import yaml from 'eslint-plugin-yml'

export default {
Expand Down

0 comments on commit ec9d967

Please sign in to comment.