41 lines
1.1 KiB
JavaScript
41 lines
1.1 KiB
JavaScript
const eslintPluginAstro = require("eslint-plugin-astro")
|
|
module.exports = [
|
|
// add more generic rule sets here, such as:
|
|
// js.configs.recommended,
|
|
...eslintPluginAstro.configs["flat/recommended"], // In CommonJS, the `flat/` prefix is required.
|
|
{
|
|
rules: {
|
|
// override/add rules settings here, such as:
|
|
// "astro/no-set-html-directive": "error"
|
|
// JavaScript rules
|
|
"prefer-const": "error",
|
|
// TypeScript rules
|
|
"@typescript-eslint/array-type": "off",
|
|
"@typescript-eslint/consistent-type-definitions": "off",
|
|
"@typescript-eslint/consistent-type-imports": [
|
|
"warn",
|
|
{
|
|
prefer: "type-imports",
|
|
fixStyle: "inline-type-imports",
|
|
},
|
|
],
|
|
"@typescript-eslint/no-unused-vars": [
|
|
"warn",
|
|
{
|
|
argsIgnorePattern: "^_",
|
|
},
|
|
],
|
|
"@typescript-eslint/require-await": "off",
|
|
"@typescript-eslint/no-misused-promises": [
|
|
"error",
|
|
{
|
|
checksVoidReturn: {
|
|
attributes: false,
|
|
},
|
|
},
|
|
],
|
|
// React rules
|
|
"react/self-closing-comp": ["error"],
|
|
},
|
|
},
|
|
]
|