@studio-fes/eslint-config
v3.0.0
Published
Shared ESLint config for studio fes Nuxt projects and Shopify themes (antfu + UnoCSS + GraphQL + Liquid).
Readme
@studio-fes/eslint-config
studio fes's ESLint config: @antfu/eslint-config with our defaults, UnoCSS class ordering and GraphQL rules. ESLint is also the formatter (no Prettier), Liquid aside.
Usage
pnpm add -D @studio-fes/eslint-config eslintIn a Nuxt project with @nuxt/eslint (the studio fes layers bring it):
// eslint.config.js
import fes from '@studio-fes/eslint-config'
import withNuxt from './.nuxt/eslint.config.mjs'
export default withNuxt(fes({ pnpm: true }))Anywhere else:
// eslint.config.js
import fes from '@studio-fes/eslint-config'
export default fes()fes(options, ...configs): options are merged into antfu's (pnpm, typescript, ignores…), the configs after it are appended as flat config items.
What it sets
- antfu's config with
formatters,vue,unocssandantislopon. unocss/orderas an error. In a layer without its ownuno.config, point the plugin at the one it extends:{ settings: { unocss: { configPath: '../layer-base/uno.config.ts' } } }.- GraphQL (
.graphql,.gql): named operations only, PascalCase, withoutGet/Query/Mutationprefixes or suffixes.graphql: falseturns it off (and doesn't load the plugin). - Ignored, on top of antfu's ignores and
.gitignore:.github,.vscode,*.md,package.json, and in Nuxt projects generated files (schema.graphql,types.ts,generated,graphql,*.d.tsof auto-imports), Storybook and Tauri.
Shopify themes
export default fes({ shopify: true })Liquid is formatted by Prettier's Liquid plugin (run by ESLint), Vue and GraphQL are off, and the JSON files the theme editor rewrites (config/, locales/, templates/, sections/) are ignored.
License
MIT
