Skip to content

Commit

Permalink
feat(eslint): use shopify prefer-early-return rule
Browse files Browse the repository at this point in the history
  • Loading branch information
DrJume committed Apr 24, 2024
1 parent 8037b8e commit 3113811
Show file tree
Hide file tree
Showing 3 changed files with 939 additions and 3 deletions.
10 changes: 10 additions & 0 deletions packages/eslint-config/index.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
import antfu from '@antfu/eslint-config'
import { FlatCompat } from '@eslint/eslintrc'
import eslintConfigPrettier from 'eslint-config-prettier'

import github from './github.js'
import nuxtRules from './nuxt.js'

delete eslintConfigPrettier.rules['vue/html-self-closing']

const compat = new FlatCompat()

/** @type {import('./index.d.ts').eslintConfig} */
export function eslintConfig(
{ nuxt, tsconfigPath, configs } = { nuxt: false, tsconfigPath: undefined, configs: undefined },
Expand Down Expand Up @@ -86,6 +89,13 @@ export function eslintConfig(
'antfu/top-level-function': 'error',
},
})
.append({
name: 'falcondev/shopify',
...compat.plugins('@shopify/eslint-plugin')[0],
rules: {
'@shopify/prefer-early-return': 'error',
},
})
.append(
{
name: 'falcondev/cjs',
Expand Down
1 change: 1 addition & 0 deletions packages/eslint-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"@antfu/eslint-config": "^2.15.0",
"@eslint/eslintrc": "^3.0.2",
"@nuxt/eslint-config": "^0.3.9",
"@shopify/eslint-plugin": "^44.0.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-github": "^4.10.2",
"typescript-eslint-parser-for-extra-files": "^0.6.0"
Expand Down
Loading

0 comments on commit 3113811

Please sign in to comment.