Skip to content

Commit

Permalink
chore(eslint): Update eslint packages and config (#882)
Browse files Browse the repository at this point in the history
* chore(eslint): Update eslint packages and config
  • Loading branch information
bubonicfred authored Jun 26, 2024
1 parent 8dec4e4 commit bb604c1
Show file tree
Hide file tree
Showing 5 changed files with 15,326 additions and 9,548 deletions.
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

0 comments on commit bb604c1

Please sign in to comment.