summaryrefslogtreecommitdiff
path: root/eslint.config.js
diff options
context:
space:
mode:
Diffstat (limited to 'eslint.config.js')
-rw-r--r--eslint.config.js80
1 files changed, 80 insertions, 0 deletions
diff --git a/eslint.config.js b/eslint.config.js
new file mode 100644
index 000000000..f1fc76d28
--- /dev/null
+++ b/eslint.config.js
@@ -0,0 +1,80 @@
+import js from '@eslint/js';
+
+export default [
+ js.configs.recommended,
+
+ {
+ files: ['js/**/*.js', 'plugins/**/*.js'],
+ languageOptions: {
+ ecmaVersion: 2022,
+ sourceType: 'script',
+ globals: {
+ // Browser
+ window: 'readonly',
+ document: 'readonly',
+ console: 'readonly',
+ alert: 'readonly',
+ confirm: 'readonly',
+ setTimeout: 'readonly',
+ setInterval: 'readonly',
+ clearTimeout: 'readonly',
+ clearInterval: 'readonly',
+ fetch: 'readonly',
+ XMLHttpRequest: 'readonly',
+ localStorage: 'readonly',
+ location: 'readonly',
+ history: 'readonly',
+
+ // tt-rss
+ App: 'writable',
+ Article: 'writable',
+ CommonDialogs: 'writable',
+ CommonFilters: 'writable',
+ Feeds: 'writable',
+ FeedStoreModel: 'writable',
+ FeedTree: 'writable',
+ Headlines: 'writable',
+ PluginHost: 'writable',
+ PrefFeedStore: 'writable',
+ PrefFeedTree: 'writable',
+ PrefFilterStore: 'writable',
+ PrefFilterTree: 'writable',
+ PrefHelpers: 'writable',
+ PrefLabelTree: 'writable',
+ PrefUsers: 'writable',
+ SingleUseDialog: 'writable',
+ Toolbar: 'writable',
+
+ // Dojo
+ dojo: 'readonly',
+ dijit: 'readonly'
+ }
+ },
+
+ rules: {
+ 'no-undef': 'warn',
+ 'no-unused-vars': 'warn',
+ 'no-console': 'off',
+
+ 'prefer-const': 'error',
+ 'no-var': 'warn',
+
+ 'eqeqeq': ['error', 'always'],
+ 'no-caller': 'error',
+ 'no-proto': 'error',
+
+ 'linebreak-style': ['error', 'unix'],
+ 'eol-last': 'error',
+ 'no-trailing-spaces': 'error',
+ 'no-multiple-empty-lines': ['error', { 'max': 2 }],
+
+ 'keyword-spacing': ['error', { 'after': true, 'before': true }],
+ 'block-spacing': ['error', 'always'],
+ 'computed-property-spacing': ['error', 'never'],
+
+ 'no-empty': ['error', { 'allowEmptyCatch': true }],
+
+ 'max-statements-per-line': ['warn', { 'max': 2 }]
+ }
+ }
+];