Skip to content

Commit

Permalink
feat: enable sxzz/prefer-string-function
Browse files Browse the repository at this point in the history
  • Loading branch information
sxzz committed Sep 9, 2024
1 parent 0c9b0cb commit d62647d
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 1 deletion.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
"eslint-plugin-perfectionist": "^3.5.0",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-regexp": "^2.6.0",
"eslint-plugin-sxzz": "^0.1.0",
"eslint-plugin-unicorn": "^55.0.0",
"eslint-plugin-unused-imports": "^4.1.3",
"eslint-plugin-vue": "^9.28.0",
Expand Down
13 changes: 13 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion src/configs/javascript.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import globals from 'globals'
import { isInEditor } from '../env'
import { configJs, pluginUnusedImports } from '../plugins'
import { configJs, pluginSxzz, pluginUnusedImports } from '../plugins'
import type { Config } from '../types'

export const restrictedSyntaxJs = [
Expand Down Expand Up @@ -28,6 +28,7 @@ export const javascript: Config[] = [
},
name: 'sxzz/js',
plugins: {
sxzz: pluginSxzz,
'unused-imports': pluginUnusedImports,
},
rules: {
Expand Down Expand Up @@ -77,6 +78,7 @@ export const javascript: Config[] = [
'prefer-spread': 'error',
'prefer-template': 'error',
'require-await': 'error',
'sxzz/prefer-string-function': 'warn',
'unicode-bom': ['error', 'never'],
'unused-imports/no-unused-imports': isInEditor ? 'off' : 'error',
'unused-imports/no-unused-vars': [
Expand Down
4 changes: 4 additions & 0 deletions src/plugins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ import * as _pluginAntfu from 'eslint-plugin-antfu'
export const pluginAntfu: typeof import('eslint-plugin-antfu').default =
interopDefault(_pluginAntfu)

import * as _pluginSxzz from 'eslint-plugin-sxzz'
export const pluginSxzz: typeof import('eslint-plugin-sxzz').default =
interopDefault(_pluginSxzz)

import * as _pluginComments from 'eslint-plugin-eslint-comments'
export const pluginComments: any = interopDefault(_pluginComments)

Expand Down

0 comments on commit d62647d

Please sign in to comment.