diff --git a/eslint.config.cjs b/eslint.config.cjs new file mode 100644 index 0000000..bd46c88 --- /dev/null +++ b/eslint.config.cjs @@ -0,0 +1,48 @@ +const html = require('eslint-plugin-html'); +const globals = require('globals'); +const js = require('@eslint/js'); + +const { + FlatCompat, +} = require('@eslint/eslintrc'); + +const compat = new FlatCompat({ + baseDirectory: __dirname, + recommendedConfig: js.configs.recommended, + allConfig: js.configs.all +}); + +module.exports = [...compat.extends('eslint:recommended'), { + plugins: { + html, + }, + + languageOptions: { + globals: { + ...globals.node, + ...globals.mocha, + ...globals.jquery, + }, + + ecmaVersion: 2018, + sourceType: 'commonjs', + }, + + rules: { + indent: ['error', 'tab', { + SwitchCase: 1, + }], + + 'no-console': 'off', + 'no-var': 'error', + 'no-trailing-spaces': 'error', + 'prefer-const': 'error', + + quotes: ['error', 'single', { + avoidEscape: true, + allowTemplateLiterals: true, + }], + + semi: ['error', 'always'], + }, +}]; \ No newline at end of file