https://github.com/tinchoz49/eslint-astro-mate
A friendly astro eslint configuration.
https://github.com/tinchoz49/eslint-astro-mate
astro eslint eslint-config formatter lint linter prettier
Last synced: 4 months ago
JSON representation
A friendly astro eslint configuration.
- Host: GitHub
- URL: https://github.com/tinchoz49/eslint-astro-mate
- Owner: tinchoz49
- License: mit
- Created: 2024-06-11T22:25:22.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-07-11T20:28:18.000Z (about 1 year ago)
- Last Synced: 2025-03-10T14:58:31.216Z (4 months ago)
- Topics: astro, eslint, eslint-config, formatter, lint, linter, prettier
- Language: JavaScript
- Homepage:
- Size: 55.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# eslint-astro-mate
> A friendly ESLint configuration for Astro projects.
- Fully compatible with [eslint-stylistic](https://github.com/eslint-stylistic/eslint-stylistic).
- Simplifies switching between different Astro configurations.
- Formats `astro` files using [prettier-plugin-astro](https://github.com/withastro/prettier-plugin-astro) without interfering with @stylistic rules.## Install
```bash
$ npm install --save-dev eslint-astro-mate
```## Usage
```javascript
import { astro } from 'eslint-astro-mate'export default astro()
```### Different configurations
```javascript
import { astro } from 'eslint-astro-mate'export default astro({
config: 'jsx-a11y-recommended'
})
```### Use same options as stylistic
```javascript
import { astro } from 'eslint-astro-mate'export default astro({
style: {
pluginName: '@stylistic',
indent: 2,
quotes: 'single',
semi: false,
arrowParens: false,
blockSpacing: true,
quoteProps: 'consistent-as-needed',
commaDangle: 'always-multiline',
}
})
```### Override rules
```javascript
import { astro } from 'eslint-astro-mate'export default astro({
overrides: {
'astro/astro/prefer-class-list-directive': 'off',
}
})
```### Change plugin prefix
Astro Mate helps you work with stylistic and TypeScript rules. To do this, it needs to know the prefix of each plugin's rules. If your configuration changes the default prefix for these plugins, you should also update it in Astro Mate.
```javascript
import { astro } from 'eslint-astro-mate'export default astro({
style: {
pluginName: '@new-prefix-style'
},
tsPluginName: '@new-prefix-typescript'
})
```## VSCode settings
In your project `.vscode/settings.json`
```json
{
"editor.defaultFormatter": "dbaeumer.vscode-eslint",
"eslint.experimental.useFlatConfig": true,
"eslint.format.enable": true,
"eslint.validate": [
"javascript",
"javascriptreact",
"typescript",
"typescriptreact",
"vue",
"html",
"markdown",
"json",
"jsonc",
"yaml",
"astro",
"css",
"tailwindcss"
]
}
```