diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 00000000..99fbae85 --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,62 @@ +module.exports = { + env: { + browser: true, + es2021: true, + }, + extends: ["eslint:recommended", "plugin:@typescript-eslint/recommended"], + overrides: [ + { + env: { + node: true, + }, + files: [".eslintrc.{js,cjs}"], + parserOptions: { + sourceType: "script", + }, + }, + { + files: ["**/lazy/**/*", "test/**/*"], + rules: { + "no-restricted-imports": "off", + }, + }, + ], + parser: "@typescript-eslint/parser", + parserOptions: { + ecmaVersion: "latest", + sourceType: "module", + }, + plugins: ["@typescript-eslint"], + rules: { + "@typescript-eslint/no-explicit-any": "off", + "@typescript-eslint/ban-ts-comment": "off", + "no-empty": "off", + "no-useless-escape": "off", + "no-case-declarations": "off", + "no-restricted-imports": [ + "error", + { + patterns: [ + { + group: ["**/lazy/**"], + message: + "These modules have to be imported lazily due to big dependencies", + }, + { + group: [ + "boltz-core", + "bitcoinjs-lib", + "liquidjs-lib", + "bolt11", + "@vulpemventures/secp256k1-zkp", + "@bitcoinerlab/secp256k1", + ], + message: + "These modules are only allowed to be imported within /lazy directories", + }, + ], + }, + ], + "prefer-const": "off", + }, +}; diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index e68ebe25..68839be5 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -16,3 +16,4 @@ jobs: - run: npm run prettier-check - run: npm run test - run: npm run tsc + - run: npm run lint diff --git a/.gitignore b/.gitignore index 000b44eb..0fe61aef 100644 --- a/.gitignore +++ b/.gitignore @@ -3,8 +3,8 @@ tags .vscode/ *.log +public/config.json dist/ ts-out/ coverage/ node_modules/ -src/config.ts diff --git a/index.html b/index.html index c629b9e3..388b8af6 100644 --- a/index.html +++ b/index.html @@ -38,6 +38,16 @@
+