@jimmy.codes/eslint-config
Version:
A simple, modern ESLint config that covers most use cases.
72 lines (70 loc) • 1.99 kB
JavaScript
import {
interopDefault
} from "./chunk-72FT76PY.js";
import {
GLOB_ASTRO
} from "./chunk-N5KZEOXT.js";
// src/configs/astro.ts
import globals from "globals";
async function astroConfig() {
const files = [GLOB_ASTRO];
const { configs, parser: parserTs } = await import("typescript-eslint");
const [astroPlugin, astroParser, jsxA11yPlugin] = await Promise.all([
import("eslint-plugin-astro"),
import("astro-eslint-parser"),
interopDefault(import("eslint-plugin-jsx-a11y"))
]);
return [
{
files,
languageOptions: {
globals: {
...globals.node,
Astro: false,
Fragment: false
},
parser: astroParser,
parserOptions: {
extraFileExtensions: [".astro"],
parser: parserTs
},
sourceType: "module"
},
name: "jimmy.codes/astro",
plugins: {
"astro": astroPlugin,
"jsx-a11y": jsxA11yPlugin
},
processor: "astro/client-side-ts",
rules: {
...jsxA11yPlugin.configs.recommended.rules,
"astro/missing-client-only-directive-value": "error",
"astro/no-conflict-set-directives": "error",
"astro/no-deprecated-astro-canonicalurl": "error",
"astro/no-deprecated-astro-fetchcontent": "error",
"astro/no-deprecated-astro-resolve": "error",
"astro/no-deprecated-getentrybyslug": "error",
"astro/no-exports-from-components": "off",
"astro/no-unused-define-vars-in-style": "error",
"astro/valid-compile": "error"
}
},
{
files,
languageOptions: {
parserOptions: configs.disableTypeChecked.languageOptions?.parserOptions
},
name: "jimmy.codes/astro/disable-type-checked",
rules: configs.disableTypeChecked.rules
},
{
name: "jimmy.codes/astro/imports",
settings: {
"import-x/core-modules": ["astro:content"]
}
}
];
}
export {
astroConfig as default
};