Skip to content

Commit

Permalink
feat: add name of config object (#386)
Browse files Browse the repository at this point in the history
* add name of config object

* fix name

* Create angry-eels-count.md
  • Loading branch information
odanado committed May 13, 2024
1 parent fc68b99 commit 876ce07
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 0 deletions.
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

0 comments on commit 876ce07

Please sign in to comment.