-
Notifications
You must be signed in to change notification settings - Fork 324
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
70 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* eslint-env node */ | ||
require('@rushstack/eslint-patch/modern-module-resolution') | ||
|
||
module.exports = { | ||
root: true, | ||
extends: [ | ||
'plugin:vue/vue3-essential', | ||
'eslint:recommended', | ||
'@vue/eslint-config-typescript', | ||
'@vue/eslint-config-prettier', | ||
'plugin:vue/vue3-recommended', | ||
'plugin:vue-pug/vue3-recommended', | ||
'plugin:astro/recommended', | ||
], | ||
parserOptions: { | ||
ecmaVersion: 'latest', | ||
}, | ||
ignorePatterns: ['postcss.config.cjs'], | ||
rules: { | ||
'vue/no-setup-props-destructure': 'off', | ||
}, | ||
overrides: [ | ||
{ | ||
files: ['src/**/*.astro'], | ||
parser: 'astro-eslint-parser', | ||
parserOptions: { | ||
parser: '@typescript-eslint/parser', | ||
extraFileExtensions: ['.astro'], | ||
}, | ||
}, | ||
], | ||
} |
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// @ts-check | ||
|
||
import eslint from '@eslint/js' | ||
import tseslint from 'typescript-eslint' | ||
import eslintConfigPrettier from 'eslint-config-prettier' | ||
|
||
export default tseslint.config({ | ||
extends: [ | ||
eslint.configs.recommended, | ||
...tseslint.configs.recommended, | ||
eslintConfigPrettier, | ||
], | ||
rules: { | ||
'@typescript-eslint/consistent-type-imports': 'error', | ||
}, | ||
}) |
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { ESLint } from 'eslint' | ||
|
||
const removeIgnoredFiles = async (files) => { | ||
const eslint = new ESLint() | ||
const isIgnored = await Promise.all( | ||
files.map((file) => { | ||
return eslint.isPathIgnored(file) | ||
}), | ||
) | ||
const filteredFiles = files | ||
.filter((_, i) => !isIgnored[i]) | ||
.map((file) => `"${file}"`) | ||
return filteredFiles.join(' ') | ||
} | ||
|
||
export default { | ||
'*.{js,ts,mjs,vue}': async (files) => { | ||
const filesToLint = await removeIgnoredFiles(files) | ||
return [`eslint ${filesToLint}`] | ||
}, | ||
'*': 'prettier --ignore-unknown --write', | ||
} |