60 lines
1.6 KiB
JavaScript
60 lines
1.6 KiB
JavaScript
import js from '@eslint/js'
|
|
import prettier from 'eslint-config-prettier/flat'
|
|
import astro from 'eslint-plugin-astro'
|
|
import reactHooks from 'eslint-plugin-react-hooks'
|
|
import unusedImports from 'eslint-plugin-unused-imports'
|
|
import globals from 'globals'
|
|
import tseslint from 'typescript-eslint'
|
|
|
|
export default [
|
|
{ ignores: ['dist/', '.astro/', 'node_modules/', 'src/content/'] },
|
|
|
|
js.configs.recommended,
|
|
...tseslint.configs.recommended,
|
|
...astro.configs.recommended,
|
|
{
|
|
name: 'dave-dmg/node',
|
|
languageOptions: { globals: globals.node },
|
|
},
|
|
{
|
|
name: 'dave-dmg/unused',
|
|
files: ['**/*.{js,mjs,cjs,ts,tsx,astro}'],
|
|
plugins: { 'unused-imports': unusedImports },
|
|
rules: {
|
|
'no-unused-vars': 'off',
|
|
'@typescript-eslint/no-unused-vars': 'off',
|
|
'unused-imports/no-unused-imports': 'warn',
|
|
'unused-imports/no-unused-vars': [
|
|
'warn',
|
|
{
|
|
vars: 'all',
|
|
args: 'after-used',
|
|
argsIgnorePattern: '^_',
|
|
varsIgnorePattern: '^_',
|
|
destructuredArrayIgnorePattern: '^_',
|
|
caughtErrorsIgnorePattern: '^(_|ignore)',
|
|
},
|
|
],
|
|
},
|
|
},
|
|
|
|
{
|
|
name: 'dave-dmg/typescript',
|
|
files: ['**/*.{ts,tsx,astro}'],
|
|
rules: {
|
|
'@typescript-eslint/ban-ts-comment': 'warn',
|
|
'@typescript-eslint/no-empty-object-type': 'warn',
|
|
'@typescript-eslint/no-explicit-any': 'warn',
|
|
},
|
|
},
|
|
|
|
{
|
|
name: 'dave-dmg/react-islands',
|
|
files: ['**/*.tsx'],
|
|
plugins: { 'react-hooks': reactHooks },
|
|
rules: reactHooks.configs.recommended.rules,
|
|
},
|
|
|
|
prettier,
|
|
]
|