Skip to content

Commit fd2f19f

Browse files
committed
Added @stylistic/eslint-plugin-js as dev dependency to lint trailing whitespace
1 parent 41e6587 commit fd2f19f

File tree

3 files changed

+22
-0
lines changed

3 files changed

+22
-0
lines changed

eslint.config.mjs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import js from '@eslint/js'
2+
import stylisticJS from '@stylistic/eslint-plugin-js'
23
import json from '@eslint/json'
34
import markdown from '@eslint/markdown'
45
import eslintPluginYml from 'eslint-plugin-yml'
@@ -7,9 +8,11 @@ export default [
78
{
89
files: ['**/*.js', '**/*.mjs'],
910
languageOptions: { ecmaVersion: 'latest', sourceType: 'script', globals: { chrome: 'readonly' }},
11+
plugins: { 'js-styles': stylisticJS },
1012
rules: {
1113
...js.configs.recommended.rules,
1214
'indent': 'off', 'no-unexpected-multiline': 'off', 'key-spacing': 'off', // allow whitespace anywhere
15+
'js-styles/no-trailing-spaces': 'error', // ...except at ends of lines
1316
'quotes': ['error', 'single', { 'allowTemplateLiterals': true }], // enforce single quotes except backticks to avoid escaping quotes
1417
'comma-dangle': ['error', 'never'], // enforce no trailing commas in arrays or objects
1518
'no-async-promise-executor': 'off', // allow promise executor functions to be async (to accomodate await lines)

package-lock.json

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

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
"devDependencies": {
2727
"@eslint/json": "^0.7.0",
2828
"@eslint/markdown": "^6.2.1",
29+
"@stylistic/eslint-plugin-js": "^2.11.0",
2930
"eslint": "^9.15.0",
3031
"eslint-plugin-yml": "^1.15.0",
3132
"husky": "^9.1.7"

0 commit comments

Comments
 (0)