summaryrefslogtreecommitdiff
path: root/eslint.config.js
diff options
context:
space:
mode:
authorGreg <supahgreg@users.noreply.github.com>2025-10-13 23:39:24 -0500
committerGitHub <noreply@github.com>2025-10-13 23:39:24 -0500
commit6505cbb592b91556ca25a2bf72ad1d8cb0b3bc2a (patch)
tree8ab133cc17a329ef7d99d152b3f6b4edc3830509 /eslint.config.js
parent0d2b1d601294802286aa26e5486c1c4fee92c05a (diff)
parent8b46ab31a96b6b6129f624719ac33ddf761805f1 (diff)
Merge pull request #42 from tt-rss/bugfix/eslint-config-and-findings
Get ESLint 9.x working, make the new config stricter, address findings
Diffstat (limited to 'eslint.config.js')
-rw-r--r--eslint.config.js43
1 files changed, 43 insertions, 0 deletions
diff --git a/eslint.config.js b/eslint.config.js
new file mode 100644
index 000000000..172f0ce21
--- /dev/null
+++ b/eslint.config.js
@@ -0,0 +1,43 @@
+import globals from 'globals';
+import js from '@eslint/js';
+import stylistic from '@stylistic/eslint-plugin';
+
+export default [
+ js.configs.recommended,
+
+ {
+ files: ['js/**/*.js', 'plugins/**/*.js'],
+ languageOptions: {
+ ecmaVersion: 2022,
+ sourceType: 'script',
+ globals: {
+ ...globals.browser,
+
+ // Dojo
+ dojo: 'readonly',
+ dijit: 'readonly'
+ }
+ },
+
+ plugins: {
+ '@stylistic/js': stylistic
+ },
+
+ rules: {
+ 'no-console': 'off',
+ 'prefer-const': 'error',
+ 'eqeqeq': ['error', 'always'],
+ 'no-empty': ['error', { 'allowEmptyCatch': true }],
+
+ // Stylistic rules (replacing those deprecated in ESLint)
+ '@stylistic/js/linebreak-style': ['error', 'unix'],
+ '@stylistic/js/eol-last': 'error',
+ '@stylistic/js/no-trailing-spaces': 'error',
+ '@stylistic/js/no-multiple-empty-lines': ['error', { 'max': 2 }],
+ '@stylistic/js/keyword-spacing': ['error', { 'after': true, 'before': true }],
+ '@stylistic/js/block-spacing': ['error', 'always'],
+ '@stylistic/js/computed-property-spacing': ['error', 'never'],
+ '@stylistic/js/max-statements-per-line': ['warn', { 'max': 2 }]
+ }
+ }
+];