-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23 from schm00g/20-investigate-accessibility
add eslint for a11y
- Loading branch information
Showing
5 changed files
with
3,745 additions
and
89 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,56 @@ | ||
module.exports = { | ||
// ... | ||
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: "astro-eslint-parser", | ||
// Parse the script in `.astro` as TypeScript by adding the following configuration. | ||
// It's the setting you need when using TypeScript. | ||
parserOptions: { | ||
parser: "@typescript-eslint/parser", | ||
extraFileExtensions: [".astro"], | ||
// The script of Astro components uses ESM. | ||
sourceType: "module", | ||
}, | ||
rules: { | ||
// Enable recommended rules | ||
"astro/no-conflict-set-directives": "error", | ||
"astro/no-unused-define-vars-in-style": "error", | ||
|
||
// override/add rules settings here, such as: | ||
// "astro/no-set-html-directive": "error" | ||
}, | ||
}, | ||
{ | ||
// 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: { | ||
// override/add rules settings here, such as: | ||
// "no-unused-vars": "error" | ||
|
||
// 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", | ||
}, | ||
}, | ||
// ... | ||
], | ||
} |
Oops, something went wrong.