Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add name of config object #386

Merged
merged 3 commits into from
May 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/angry-eels-count.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"eslint-plugin-astro": patch
---

feat: add name of config object
4 changes: 4 additions & 0 deletions src/configs/flat/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { environments } from "../../environments/index"
let plugin: unknown
export default [
{
name: "astro/base/plugin",
plugins: {
get astro(): ESLint.Plugin {
// eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires -- ignore
Expand All @@ -20,6 +21,7 @@ export default [
},
},
{
name: "astro/base",
files: ["*.astro", "**/*.astro"],
languageOptions: {
globals: {
Expand All @@ -45,6 +47,7 @@ export default [
{
// Define the configuration for `<script>` tag.
// Script in `<script>` is assigned a virtual file name with the `.js` extension.
name: "astro/base/javascript",
files: ["**/*.astro/*.js", "*.astro/*.js"],
languageOptions: {
globals: {
Expand All @@ -61,6 +64,7 @@ export default [
{
// Define the configuration for `<script>` tag when using `client-side-ts` processor.
// Script in `<script>` is assigned a virtual file name with the `.ts` extension.
name: "astro/base/typescript",
files: ["**/*.astro/*.ts", "*.astro/*.ts"],
languageOptions: {
globals: {
Expand Down
1 change: 1 addition & 0 deletions src/configs/flat/recommended.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import base from "./base"
export default [
...base,
{
name: "astro/recommended",
rules: {
// eslint-plugin-astro rules
"astro/missing-client-only-directive-value": "error",
Expand Down
5 changes: 5 additions & 0 deletions tools/update-rulesets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ import { environments } from "../../environments/index"
let plugin: unknown
export default [
{
name: 'astro/base/plugin',
plugins: {
get astro(): ESLint.Plugin {
// eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires -- ignore
Expand All @@ -122,6 +123,7 @@ export default [
},
},
{
name: 'astro/base',
files: ["*.astro", "**/*.astro"],
languageOptions: {
globals: {
Expand Down Expand Up @@ -151,6 +153,7 @@ export default [
{
// Define the configuration for \`<script>\` tag.
// Script in \`<script>\` is assigned a virtual file name with the \`.js\` extension.
name: 'astro/base/javascript',
files: ["**/*.astro/*.js", "*.astro/*.js"],
languageOptions: {
globals: {
Expand All @@ -167,6 +170,7 @@ export default [
{
// Define the configuration for \`<script>\` tag when using \`client-side-ts\` processor.
// Script in \`<script>\` is assigned a virtual file name with the \`.ts\` extension.
name: 'astro/base/typescript',
files: ["**/*.astro/*.ts", "*.astro/*.ts"],
languageOptions: {
globals: {
Expand Down Expand Up @@ -225,6 +229,7 @@ import base from './base';
export default [
...base,
{
name: 'astro/recommended',
rules: {
// eslint-plugin-astro rules
${recommendedRules
Expand Down
Loading