@simplo-sro/eslint-config
v2.2.0
Published
ESLint config for Simplo projects
Downloads
131
Readme
eslint-config-simplo
Sharable flat ESLint config for Simplo projects
Using the config
Use ESLint >= v8.45.0 for flat config support.
Install the @simplo-sro/eslint-config
package.
For Webpack / Vite
For shop admin / themes
Import the config package:
const simploConfig = require('@simplo-sro/eslint-config');
(or with ESM syntax)
import simploConfig from '@simplo-sro/eslint-config';
Then append the generated config from this package, as such:
...simploConfig.createConfig({ projectType: 'webpack-vite' }),
Nuxt
Use the ESLint module.
Generate the config with withNuxt()
, passing this package's config as such:
import simploConfig from '@simplo-sro/eslint-config';
export default withNuxt(
...simploConfig.createConfig({ projectType: 'nuxt' }),
)
This will first generate the config for your Nuxt project, then overrides it with rules generated in this config package.
Nuxt ESLint plugin will import ESLint plugins by default, and since those plugins are already imported in this config, this will lead to duplicate imports - to which, ESLint will respond with a crash.
So, don't forget to add this to the root of your nuxt.config.ts
eslint: {
config: {
standalone: false,
}
},
Configurations
This config is split into multiple sub-configs in /configurations
:
base
simplo/base
- overrides for ESLint recommended rulessimplo/base/formatting
- rules for formatting/style from@stylistic/eslint-plugin
vue
- Overrides forflat/recommended
rules fromeslint-plugin-vue
typescript
- Typescript specific rules (includes rules ported over from@nuxtjs/eslint-config-typescript
) and overrides fortseslint.configs.recommended
fromtypescript-eslint
tailwind
- Overrides forflat/recommended
rules fromeslint-plugin-tailwindcss
Linting the config
This config is self-linting:
npm run lint
npm run lint:fix