Skip to content

Commit

Permalink
feat: Add @stylistic/eslint-plugin-js (#138)
Browse files Browse the repository at this point in the history
  • Loading branch information
lachlancollins authored Jul 26, 2024
1 parent 2422e01 commit f5f7fe1
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
"dependencies": {
"@commitlint/parse": "^19.0.3",
"@eslint/js": "^8.57.0",
"@stylistic/eslint-plugin-js": "^2.3.0",
"commander": "^12.1.0",
"current-git-branch": "^1.1.0",
"esbuild-register": "^3.5.0",
Expand Down
5 changes: 5 additions & 0 deletions packages/config/src/eslint/index.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import tseslint from 'typescript-eslint'
import stylisticJs from '@stylistic/eslint-plugin-js'
import pluginImport from 'eslint-plugin-import-x'
import pluginNode from 'eslint-plugin-n'
import globals from 'globals'
import { javascriptRules } from './javascript.js'
import { importRules } from './import.js'
import { typescriptRules } from './typescript.js'
import { nodeRules } from './node.js'
import { stylisticRules } from './stylistic.js'

const GLOB_INCLUDE = ['**/*.{js,svelte,ts,tsx,vue}']

Expand Down Expand Up @@ -42,6 +44,8 @@ export const tanstackConfig = [
},
},
plugins: {
// @ts-expect-error
'@stylistic/js': stylisticJs,
// @ts-expect-error
'@typescript-eslint': tseslint.plugin,
// @ts-expect-error
Expand All @@ -53,6 +57,7 @@ export const tanstackConfig = [
...typescriptRules,
...importRules,
...nodeRules,
...stylisticRules,
},
},
]
7 changes: 7 additions & 0 deletions packages/config/src/eslint/stylistic.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// https://eslint.style/packages/js

/** @type {import('eslint').Linter.RulesRecord} */
export const stylisticRules = {
/** Enforce consistency of spacing after the start of a comment */
'@stylistic/js/spaced-comment': 'error',
}
33 changes: 33 additions & 0 deletions pnpm-lock.yaml

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

0 comments on commit f5f7fe1

Please sign in to comment.