Skip to content

Commit

Permalink
fix(sdk): Updates to eslint, and fixes from that
Browse files Browse the repository at this point in the history
- Use latest eslint and typescript
- Uncovered an error in a unit test for configurations, which should now be more strict
- TS 5.2+ requires 'node' style modules to load node_modules packages
  • Loading branch information
dmihalcik-virtru committed Feb 18, 2025
1 parent dfb1a6f commit 208cec2
Show file tree
Hide file tree
Showing 17 changed files with 3,566 additions and 3,124 deletions.
9 changes: 0 additions & 9 deletions cli/.eslintrc.yaml

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 globals from "globals";
import path from "node:path";
import { fileURLToPath } from "node:url";
import typescriptEslint from "@typescript-eslint/eslint-plugin";
import js from "@eslint/js";
import { FlatCompat } from "@eslint/eslintrc";
import pluginChaiFriendly from "eslint-plugin-chai-friendly";

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("plugin:@typescript-eslint/recommended", "plugin:prettier/recommended"), {
plugins: {
"chai-friendly": pluginChaiFriendly,
"@typescript-eslint": typescriptEslint,
},
languageOptions: {
globals: {
...globals.browser,
...globals.node,
},

ecmaVersion: 5,
sourceType: "commonjs",

parserOptions: {
project: ["**/tsconfig.json"],
},

},
rules: {
// See https://www.npmjs.com/package/eslint-plugin-chai-friendly
"@typescript-eslint/no-unused-expressions": "off", // disable original rule
"chai-friendly/no-unused-expressions": "error"
},
}];
Loading

0 comments on commit 208cec2

Please sign in to comment.