|
3 ay önce | |
---|---|---|
.. | ||
.github | 3 ay önce | |
.vscode | 3 ay önce | |
src | 3 ay önce | |
.gitignore | 3 ay önce | |
.npmrc | 3 ay önce | |
.release-it.json | 3 ay önce | |
CHANGELOG.md | 3 ay önce | |
CODE_OF_CONDUCT.md | 3 ay önce | |
CONTRIBUTING.md | 3 ay önce | |
LICENSE | 3 ay önce | |
README.md | 3 ay önce | |
eslint.config.ts | 3 ay önce | |
package.json | 3 ay önce | |
pnpm-lock.yaml | 3 ay önce | |
renovate.json | 3 ay önce | |
tsconfig.json | 3 ay önce | |
tsup.config.ts | 3 ay önce |
Opinionated but flexible ESlint config, based on
@antfu/eslint-config
with TresJS preferences. Also includes optional rulesets for Nuxt.
This is my personal ESlint configuration, based on the excellent @antfu/eslint-config
. It only deviates for some minor tweaks and personal preferences, since I agree almost completely with Anthony's style choices.
My config also adds some additional and optional rulesets for Nuxt.
Some of the main features, inherited directly from @antfu/eslint-config
:
.gitignore
by defaultMy own customizations and preferences:
10
for singleline, 1
for multiline)antfu/top-level-function
to allow arrow syntax on top level functions@nuxt/eslint-config
)pnpm i -D eslint @tresjs/eslint-config
With "type": "module"
in package.json
(recommended):
Using the default config without arguments uses the following @antfu/eslint-config
options as defaults:
enables ESlint Stylistic
// eslint.config.js
import { tresLintConfig } from '@tresjs/eslint-config'
export default tresLintConfig()
It is possible to add custom rules with the following configuration.
@antfu/eslint-config
(read more on its docs for possible options). It must always be present even if left empty.From the second item going on, you can add as many custom ESlint flat config objects as you need.
// eslint.config.js
import { tresLintConfig } from '@tresjs/eslint-config'
export default tresLintConfig(
// @antfu/eslint-config options, must be the first argument
{
stylistic: false,
},
// Addtionals flat configs start from here
{
rules: {
curly: 'off',
},
},
)
This package also provides optional configuration for Nuxt. To use it, simply add the nuxt
config to the list of configs.
// eslint.config.js
import { nuxt, tresLintConfig } from '@tresjs/eslint-config'
export default tresLintConfig(
{}, // @antfu/eslint-config options, must always be present as first item even if empty
nuxt,
{
// ESlint Flat config rule object
},
)
If you use VS Code, you should manually enable support for ESLint flat config.
Install VS Code ESLint extension.
Add the following settings to your .vscode/settings.json
:
{
// Enable the ESLint flat config support
"eslint.experimental.useFlatConfig": true
}
For more settings, check the "VS Code support" section in antfu/eslint-config