Skip to content

Commit f5f7fe1

Browse files
feat: Add @stylistic/eslint-plugin-js (#138)
1 parent 2422e01 commit f5f7fe1

File tree

4 files changed

+46
-0
lines changed

4 files changed

+46
-0
lines changed

packages/config/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
"dependencies": {
6262
"@commitlint/parse": "^19.0.3",
6363
"@eslint/js": "^8.57.0",
64+
"@stylistic/eslint-plugin-js": "^2.3.0",
6465
"commander": "^12.1.0",
6566
"current-git-branch": "^1.1.0",
6667
"esbuild-register": "^3.5.0",

packages/config/src/eslint/index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
import tseslint from 'typescript-eslint'
2+
import stylisticJs from '@stylistic/eslint-plugin-js'
23
import pluginImport from 'eslint-plugin-import-x'
34
import pluginNode from 'eslint-plugin-n'
45
import globals from 'globals'
56
import { javascriptRules } from './javascript.js'
67
import { importRules } from './import.js'
78
import { typescriptRules } from './typescript.js'
89
import { nodeRules } from './node.js'
10+
import { stylisticRules } from './stylistic.js'
911

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

@@ -42,6 +44,8 @@ export const tanstackConfig = [
4244
},
4345
},
4446
plugins: {
47+
// @ts-expect-error
48+
'@stylistic/js': stylisticJs,
4549
// @ts-expect-error
4650
'@typescript-eslint': tseslint.plugin,
4751
// @ts-expect-error
@@ -53,6 +57,7 @@ export const tanstackConfig = [
5357
...typescriptRules,
5458
...importRules,
5559
...nodeRules,
60+
...stylisticRules,
5661
},
5762
},
5863
]
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// https://eslint.style/packages/js
2+
3+
/** @type {import('eslint').Linter.RulesRecord} */
4+
export const stylisticRules = {
5+
/** Enforce consistency of spacing after the start of a comment */
6+
'@stylistic/js/spaced-comment': 'error',
7+
}

pnpm-lock.yaml

Lines changed: 33 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)