Skip to content

Commit

Permalink
Upgrade eslint (#525)
Browse files Browse the repository at this point in the history
* Upgrade eslint

* Migrate eslinrc.json to eslint.config.mjs
  • Loading branch information
rocketstack-matt authored Oct 28, 2024
1 parent 2b25904 commit b9f831b
Show file tree
Hide file tree
Showing 6 changed files with 280 additions and 329 deletions.
38 changes: 0 additions & 38 deletions cli/.eslintrc.json

This file was deleted.

41 changes: 41 additions & 0 deletions cli/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import typescriptEslint from "@typescript-eslint/eslint-plugin";
import globals from "globals";
import tsParser from "@typescript-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 [
...compat.extends("eslint:recommended", "plugin:@typescript-eslint/recommended"),
{
plugins: {
"@typescript-eslint": typescriptEslint,
},

languageOptions: {
globals: {
...globals.browser,
},

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

rules: {
indent: ["error", 4],
"linebreak-style": ["error", "unix"],
quotes: ["error", "single"],
semi: ["error", "always"],
},
},
];
Loading

0 comments on commit b9f831b

Please sign in to comment.