Skip to content

Commit

Permalink
Added @stylistic/eslint-plugin-js as dev dependency to lint trailing …
Browse files Browse the repository at this point in the history
…whitespace
  • Loading branch information
adamlui committed Nov 21, 2024
1 parent 3cefe45 commit 8300fc4
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 1 deletion.
4 changes: 3 additions & 1 deletion eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import js from '@eslint/js'
import globals from 'globals'
import stylisticJS from '@stylistic/eslint-plugin-js'
import json from '@eslint/json'
import markdown from '@eslint/markdown'
import * as regexp from 'eslint-plugin-regexp'
Expand All @@ -10,10 +11,11 @@ export default [
{
files: ['**/*.js', '**/*.mjs'], ignores: ['**/*.min.js'],
languageOptions: { ecmaVersion: 'latest', sourceType: 'script', globals: { ...globals.node }},
plugins: { regexp },
plugins: { regexp, 'js-styles': stylisticJS },
rules: {
...js.configs.recommended.rules, ...regexp.configs['flat/recommended'].rules,
'indent': 'off', 'no-unexpected-multiline': 'off', 'key-spacing': 'off', // allow whitespace anywhere
'js-styles/no-trailing-spaces': 'error', // ...except at ends of lines
'quotes': ['error', 'single', { 'allowTemplateLiterals': true }], // enforce single quotes except backticks to avoid escaping quotes
'comma-dangle': ['error', 'never'], // enforce no trailing commas in arrays or objects
'no-async-promise-executor': 'off', // allow promise executor functions to be async (to accomodate await lines)
Expand Down
31 changes: 31 additions & 0 deletions package-lock.json

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

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"devDependencies": {
"@eslint/json": "^0.7.0",
"@eslint/markdown": "^6.2.1",
"@stylistic/eslint-plugin-js": "^2.11.0",
"eslint": "^9.15.0",
"eslint-plugin-regexp": "^2.7.0",
"eslint-plugin-yml": "^1.15.0",
Expand Down

0 comments on commit 8300fc4

Please sign in to comment.