2025-03-22 11:21:49 -04:00
|
|
|
'use strict';
|
|
|
|
|
|
2025-04-18 21:57:12 -04:00
|
|
|
import serverConfig from 'eslint-config-nodebb';
|
|
|
|
|
import publicConfig from 'eslint-config-nodebb/public';
|
2025-04-22 17:15:48 -04:00
|
|
|
import commonRules from 'eslint-config-nodebb/common';
|
2025-03-22 11:21:49 -04:00
|
|
|
|
2025-04-18 21:57:12 -04:00
|
|
|
import { defineConfig } from 'eslint/config';
|
2025-05-30 17:12:54 -04:00
|
|
|
import stylisticJs from '@stylistic/eslint-plugin'
|
2025-04-22 17:15:48 -04:00
|
|
|
import js from '@eslint/js';
|
2025-04-18 21:57:12 -04:00
|
|
|
import globals from 'globals';
|
|
|
|
|
|
|
|
|
|
export default defineConfig([
|
2025-03-22 11:21:49 -04:00
|
|
|
{
|
|
|
|
|
ignores: [
|
|
|
|
|
'node_modules/',
|
|
|
|
|
'.project',
|
|
|
|
|
'.vagrant',
|
|
|
|
|
'.DS_Store',
|
|
|
|
|
'.tx',
|
|
|
|
|
'logs/',
|
|
|
|
|
'public/uploads/',
|
|
|
|
|
'public/vendor/',
|
|
|
|
|
'.idea/',
|
|
|
|
|
'.vscode/',
|
|
|
|
|
'*.ipr',
|
|
|
|
|
'*.iws',
|
|
|
|
|
'coverage/',
|
|
|
|
|
'build/',
|
|
|
|
|
'test/files/',
|
|
|
|
|
'*.min.js',
|
|
|
|
|
'install/docker/',
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
// tests
|
|
|
|
|
{
|
2025-04-22 17:15:48 -04:00
|
|
|
plugins: {
|
|
|
|
|
js,
|
|
|
|
|
'@stylistic/js': stylisticJs,
|
|
|
|
|
},
|
|
|
|
|
extends: ['js/recommended'],
|
2025-03-22 11:21:49 -04:00
|
|
|
files: ['test/**/*.js'],
|
|
|
|
|
languageOptions: {
|
|
|
|
|
ecmaVersion: 2020,
|
|
|
|
|
sourceType: 'commonjs',
|
|
|
|
|
globals: {
|
|
|
|
|
...globals.node,
|
|
|
|
|
...globals.browser,
|
|
|
|
|
it: 'readonly',
|
|
|
|
|
describe: 'readonly',
|
|
|
|
|
before: 'readonly',
|
|
|
|
|
beforeEach: 'readonly',
|
|
|
|
|
after: 'readonly',
|
|
|
|
|
afterEach: 'readonly',
|
|
|
|
|
},
|
2025-04-22 17:15:48 -04:00
|
|
|
},
|
2025-03-22 11:21:49 -04:00
|
|
|
rules: {
|
2025-04-22 17:15:48 -04:00
|
|
|
...commonRules,
|
|
|
|
|
'no-unused-vars': 'off',
|
2025-03-22 11:21:49 -04:00
|
|
|
'no-prototype-builtins': 'off',
|
|
|
|
|
}
|
2025-04-22 17:15:48 -04:00
|
|
|
},
|
2025-03-22 11:21:49 -04:00
|
|
|
...publicConfig,
|
|
|
|
|
...serverConfig
|
2025-04-18 21:57:12 -04:00
|
|
|
]);
|
2025-03-22 11:21:49 -04:00
|
|
|
|