Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(eslint): Update eslint packages and config #882

Merged
merged 2 commits into from
Jun 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 0 additions & 58 deletions .eslintrc.json

This file was deleted.

1 change: 0 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ repos:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
- id: check-json
- id: no-commit-to-branch
- id: check-yaml
Expand Down
80 changes: 80 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
import { fixupConfigRules, fixupPluginRules } from "@eslint/compat";
import meteor from "eslint-plugin-meteor";
import lodash from "eslint-plugin-lodash";
import noJquery from "eslint-plugin-no-jquery";
import babel from "@babel/eslint-plugin";
import promise from "eslint-plugin-promise";
import deprecate from "eslint-plugin-deprecate";
import jsdoc from "eslint-plugin-jsdoc";
import globals from "globals";
import babelParser from "@babel/eslint-parser";
import path from "node:path";
import { fileURLToPath } from "node:url";
import js from "@eslint/js";
import { FlatCompat } from "@eslint/eslintrc";

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all
});


export default [{
ignores: ["client/4minitz.html"],
}, ...fixupConfigRules(compat.extends(
"eslint:recommended",
"plugin:meteor/recommended",
"plugin:lodash/canonical",
"prettier",
"plugin:node/recommended",
"plugin:you-dont-need-lodash-underscore/compatible",
"plugin:no-jquery/all",
"plugin:promise/recommended",
"plugin:mocha-cleanup/recommended",
"plugin:mocha/recommended",
)), {
plugins: {
meteor: fixupPluginRules(meteor),
lodash: fixupPluginRules(lodash),
"no-jquery": fixupPluginRules(noJquery),
"@babel": babel,
promise: fixupPluginRules(promise),
deprecate,
jsdoc,
'@stylistic',
stylistic: StylisticPlugin
},
StylisticPlugin.configs['disable-legacy'],
languageOptions: {
globals: {
...globals.browser,
...globals.node,
},

parser: babelParser,
ecmaVersion: "latest",
sourceType: "module",
},

rules: {
"node/no-unsupported-features/es-syntax": "off",
"node/no-missing-import": "off",
"lodash/prefer-lodash-method": "off",
"lodash/prefer-lodash-typecheck": "off",
"lodash/prefer-get": "off",
"lodash/prefer-noop": "off",
"lodash/prefer-constant": "off",
"lodash/preferred-alias": "error",
"@stylistic/new-cap": "error",
"@babel/no-invalid-this": "error",
"@babel/no-unused-expressions": "error",
"@stylistic/object-curly-spacing": ["error", "always"],
"@stylistic/semi": "error",
"prefer-template": "error",
eqeqeq: ["error", "smart"],
"object-shorthand": ["error", "always"],
},
}];
Loading
Loading