-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(sdk): Updates to eslint, and fixes from that (#423)
- 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
1 parent
dfb1a6f
commit fa9271d
Showing
19 changed files
with
3,264 additions
and
5,869 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
}, | ||
}]; |
Oops, something went wrong.