-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add option for rule
@typescript-eslint/restrict-template-expressions
* fix `Parse errors in imported module '': parserPath or languageOptions.parser is required!`: un-ts/eslint-plugin-import-x#85 (comment) @ eslint.config.js * re-plug eslint: pzmosquito/eslint-import-resolver-vite#12 (comment) @ package.json * fix some violations of eslint rules @ fe
- Loading branch information
Showing
8 changed files
with
38 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -382,6 +382,7 @@ const rules = [{ // as of [email protected] | |
'@typescript-eslint/no-unsafe-enum-comparison': 'error', | ||
'@typescript-eslint/no-unsafe-unary-minus': 'error', | ||
'@typescript-eslint/parameter-properties': ['error', { prefer: 'parameter-property' }], | ||
'@typescript-eslint/restrict-template-expressions': ['error', { allowNumber: true }], | ||
}, | ||
}, { // as of [email protected] | ||
optout: { | ||
|
@@ -520,20 +521,25 @@ const rules = [{ // as of [email protected] | |
}, | ||
}]; | ||
|
||
import viteConfig from './vite.config.ts'; | ||
import pluginStylistic from '@stylistic/eslint-plugin'; | ||
import pluginImportX from 'eslint-plugin-import-x'; | ||
import pluginUnicorn from 'eslint-plugin-unicorn'; | ||
import * as typescriptESLintParserForExtraFiles from 'typescript-eslint-parser-for-extra-files'; | ||
import * as vueESLintParser from 'vue-eslint-parser'; | ||
// eslint-disable-next-line import-x/extensions | ||
import vueESLintConfigTypescriptRecommendedExtends from '@vue/eslint-config-typescript/recommended.js'; | ||
import pluginVue from 'eslint-plugin-vue'; | ||
import { fixupConfigRules } from '@eslint/compat'; | ||
import { FlatCompat } from '@eslint/eslintrc'; | ||
import eslintJs from '@eslint/js'; | ||
import pluginStylistic from '@stylistic/eslint-plugin'; | ||
import stylisticMigrate from '@stylistic/eslint-plugin-migrate'; | ||
import pluginImportX from 'eslint-plugin-import-x'; | ||
import pluginUnicorn from 'eslint-plugin-unicorn'; | ||
// eslint-disable-next-line import-x/extensions | ||
import { tsImport } from 'tsx/esm/api'; | ||
import * as typescriptESLintParserForExtraFiles from 'typescript-eslint-parser-for-extra-files'; | ||
import * as _ from 'lodash-es'; | ||
|
||
// https://github.com/pzmosquito/eslint-import-resolver-vite/issues/12#issuecomment-2151349705 | ||
const viteConfig = await tsImport('./vite.config.ts', import.meta.url); | ||
|
||
// https://github.com/eslint/eslint/issues/18093 | ||
// https://github.com/eslint/eslint/issues/18391 | ||
const compat = new FlatCompat(); | ||
|
@@ -546,8 +552,11 @@ export default [ | |
'plugin:@typescript-eslint/strict-type-checked', | ||
'plugin:@typescript-eslint/stylistic-type-checked', | ||
), | ||
...compat.config(pluginImportX.configs.recommended), // https://github.com/un-ts/eslint-plugin-import-x/issues/29#issuecomment-2148843214 | ||
...compat.config(pluginImportX.configs.typescript), | ||
{ // https://github.com/un-ts/eslint-plugin-import-x/pull/85#issuecomment-2153376351 | ||
plugins: { 'import-x': { rules: pluginImportX.rules } }, | ||
rules: pluginImportX.configs.recommended.rules, | ||
}, // https://github.com/import-js/eslint-plugin-import/issues/2556#issuecomment-2119520339 | ||
pluginImportX.configs.typescript, | ||
...fixupConfigRules(...compat.extends( | ||
'plugin:@tanstack/eslint-plugin-query/recommended', // https://github.com/TanStack/query/pull/7253 | ||
)), | ||
|
@@ -562,6 +571,12 @@ export default [ | |
tsconfigRootDir: import.meta.dirname, | ||
}, | ||
}, | ||
settings: { | ||
'import-x/resolver': { | ||
typescript: true, | ||
vite: { viteConfig }, // https://github.com/pzmosquito/eslint-import-resolver-vite/issues/12#issuecomment-2148676875 | ||
}, | ||
}, | ||
plugins: { '@stylistic': pluginStylistic }, | ||
|
||
// https://stackoverflow.com/questions/30221286/how-to-convert-an-array-of-objects-to-an-object-in-lodash/36692117#36692117 | ||
|
@@ -576,7 +591,6 @@ export default [ | |
{ | ||
files: ['**/*.ts'], | ||
languageOptions: { parser: typescriptESLintParserForExtraFiles }, | ||
settings: { 'import-x/resolver': { typescript: true } }, | ||
}, | ||
{ | ||
files: ['**/*.vue'], | ||
|
@@ -588,12 +602,6 @@ export default [ | |
tsconfigRootDir: import.meta.dirname, | ||
}, | ||
}, | ||
settings: { | ||
'import-x/resolver': { | ||
typescript: true, | ||
vite: { viteConfig }, // https://github.com/pzmosquito/eslint-import-resolver-vite/issues/12#issuecomment-2148676875 | ||
}, | ||
}, | ||
}, | ||
{ | ||
files: ['eslint.config.js'], | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,8 +6,7 @@ | |
"scripts": { | ||
"dev": "vite", | ||
"build": "vue-tsc && vite build", | ||
"preview": "vite preview", | ||
"eslint": "tsx .yarn/unplugged/eslint-npm-*/node_modules/eslint/bin/eslint.js" | ||
"preview": "vite preview" | ||
}, | ||
"dependencies": { | ||
"@fortawesome/fontawesome-svg-core": "^6.5.2", | ||
|
@@ -81,10 +80,5 @@ | |
"not ie 11", | ||
"not dead" | ||
], | ||
"packageManager": "[email protected]", | ||
"dependenciesMeta": { | ||
"[email protected]": { | ||
"unplugged": true | ||
} | ||
} | ||
"packageManager": "[email protected]" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5685,9 +5685,6 @@ __metadata: | |
vue-eslint-parser: "npm:^9.4.3" | ||
vue-router: "npm:^4.3.2" | ||
vue-tsc: "npm:^2.0.19" | ||
dependenciesMeta: | ||
[email protected]: | ||
unplugged: true | ||
languageName: unknown | ||
linkType: soft | ||
|
||
|