-
-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix: crash in esm * Create late-roses-pull.md * fix
- Loading branch information
Showing
6 changed files
with
155 additions
and
138 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"eslint-plugin-astro": patch | ||
--- | ||
|
||
fix: crash in ESM |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,75 +1,81 @@ | ||
// IMPORTANT! | ||
// This file has been automatically generated, | ||
// in order to update its content execute "npm run update" | ||
import type { Linter } from "eslint" | ||
import { hasTypescriptEslintParser } from "./has-typescript-eslint-parser" | ||
|
||
export default { | ||
plugins: ["astro"], | ||
overrides: [ | ||
{ | ||
// Define the configuration for `.astro` file. | ||
files: ["*.astro"], | ||
// Enable this plugin | ||
plugins: ["astro"], | ||
env: { | ||
// Enables global variables available in Astro components. | ||
node: true, | ||
"astro/astro": true, | ||
es2020: true, | ||
/** | ||
* Build legacy base config | ||
*/ | ||
export function buildLegacyBase(): Linter.Config { | ||
return { | ||
plugins: ["astro"], | ||
overrides: [ | ||
{ | ||
// Define the configuration for `.astro` file. | ||
files: ["*.astro"], | ||
// Enable this plugin | ||
plugins: ["astro"], | ||
env: { | ||
// Enables global variables available in Astro components. | ||
node: true, | ||
"astro/astro": true, | ||
es2020: true, | ||
}, | ||
// Allows Astro components to be parsed. | ||
parser: require.resolve("astro-eslint-parser"), | ||
// Parse the script in `.astro` as TypeScript by adding the following configuration. | ||
parserOptions: { | ||
parser: hasTypescriptEslintParser | ||
? "@typescript-eslint/parser" | ||
: undefined, | ||
extraFileExtensions: [".astro"], | ||
// The script of Astro components uses ESM. | ||
sourceType: "module", | ||
}, | ||
rules: { | ||
// eslint-plugin-astro rules | ||
// Enable base rules | ||
}, | ||
}, | ||
// Allows Astro components to be parsed. | ||
parser: require.resolve("astro-eslint-parser"), | ||
// Parse the script in `.astro` as TypeScript by adding the following configuration. | ||
parserOptions: { | ||
{ | ||
// Define the configuration for `<script>` tag. | ||
// Script in `<script>` is assigned a virtual file name with the `.js` extension. | ||
files: ["**/*.astro/*.js", "*.astro/*.js"], | ||
env: { | ||
browser: true, | ||
es2020: true, | ||
}, | ||
parserOptions: { | ||
sourceType: "module", | ||
}, | ||
rules: { | ||
// If you are using "prettier/prettier" rule, | ||
// you don't need to format inside <script> as it will be formatted as a `.astro` file. | ||
"prettier/prettier": "off", | ||
}, | ||
}, | ||
{ | ||
// 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. | ||
files: ["**/*.astro/*.ts", "*.astro/*.ts"], | ||
env: { | ||
browser: true, | ||
es2020: true, | ||
}, | ||
parser: hasTypescriptEslintParser | ||
? "@typescript-eslint/parser" | ||
: undefined, | ||
extraFileExtensions: [".astro"], | ||
// The script of Astro components uses ESM. | ||
sourceType: "module", | ||
}, | ||
rules: { | ||
// eslint-plugin-astro rules | ||
// Enable base rules | ||
}, | ||
}, | ||
{ | ||
// Define the configuration for `<script>` tag. | ||
// Script in `<script>` is assigned a virtual file name with the `.js` extension. | ||
files: ["**/*.astro/*.js", "*.astro/*.js"], | ||
env: { | ||
browser: true, | ||
es2020: true, | ||
}, | ||
parserOptions: { | ||
sourceType: "module", | ||
}, | ||
rules: { | ||
// If you are using "prettier/prettier" rule, | ||
// you don't need to format inside <script> as it will be formatted as a `.astro` file. | ||
"prettier/prettier": "off", | ||
}, | ||
}, | ||
{ | ||
// 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. | ||
files: ["**/*.astro/*.ts", "*.astro/*.ts"], | ||
env: { | ||
browser: true, | ||
es2020: true, | ||
}, | ||
parser: hasTypescriptEslintParser | ||
? "@typescript-eslint/parser" | ||
: undefined, | ||
parserOptions: { | ||
sourceType: "module", | ||
project: null, | ||
}, | ||
rules: { | ||
// If you are using "prettier/prettier" rule, | ||
// you don't need to format inside <script> as it will be formatted as a `.astro` file. | ||
"prettier/prettier": "off", | ||
parserOptions: { | ||
sourceType: "module", | ||
project: null, | ||
}, | ||
rules: { | ||
// If you are using "prettier/prettier" rule, | ||
// you don't need to format inside <script> as it will be formatted as a `.astro` file. | ||
"prettier/prettier": "off", | ||
}, | ||
}, | ||
}, | ||
], | ||
], | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters