diff --git a/.eslintingore b/.eslintingore deleted file mode 100644 index b6072742..00000000 --- a/.eslintingore +++ /dev/null @@ -1,7 +0,0 @@ -lib -debug -test/code/ -lib/ -test/kubernetes -test/argo-rollout -CHANGELOG.md diff --git a/.eslintrc.js b/.eslintrc.js index 56dcbb4a..8cb9d76a 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,19 +1,53 @@ +/** + * @type {import("eslint").Linter.Config} + */ module.exports = { env: { browser: true, - es2021: true, + es2022: true, + node: true, }, - extends: ["eslint:recommended", "plugin:@typescript-eslint/recommended", "plugin:import/typescript"], + extends: ["eslint:recommended", "plugin:@typescript-eslint/recommended", "plugin:import/typescript", "prettier"], parser: "@typescript-eslint/parser", parserOptions: { ecmaVersion: 12, - project: "tsconfig.json", + project: ["tsconfig.json"], sourceType: "module", }, - plugins: ["@typescript-eslint"], + plugins: ["@typescript-eslint", "simple-import-sort", "unused-imports"], rules: { + eqeqeq: "error", "no-unused-vars": "off", - "@typescript-eslint/ban-types": "warn", - "@typescript-eslint/no-namespace": "off", + "unused-imports/no-unused-imports": "error", + "@typescript-eslint/no-explicit-any": "error", + "@typescript-eslint/no-unused-vars": [ + "error", + { + argsIgnorePattern: "^_", + varsIgnorePattern: "^_", + caughtErrorsIgnorePattern: "^_", + }, + ], + "@typescript-eslint/ban-types": [ + "error", + { + types: { + // un-ban a type that's banned by default + "{}": false, + }, + extendDefaults: true, + }, + ], + "@typescript-eslint/no-explicit-any": "off", }, + overrides: [ + { + files: ["example/**"], + rules: { + "@typescript-eslint/no-unused-vars": "off", + "@typescript-eslint/no-empty-interface": "off", + "@typescript-eslint/no-namespace": "off", + }, + }, + ], }; diff --git a/.gitignore b/.gitignore index 7780cbf2..665ba3bc 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,6 @@ package-lock.json private_npm_cache test/code debug +test/kubernetes +test/argo-rollout +CHANGELOG.md diff --git a/example/readme-sample/use-extract-schema-params.ts b/example/readme-sample/use-extract-schema-params.ts index 850b5483..7886d872 100644 --- a/example/readme-sample/use-extract-schema-params.ts +++ b/example/readme-sample/use-extract-schema-params.ts @@ -2,7 +2,7 @@ import * as Types from "@himenon/openapi-typescript-code-generator/types"; interface Option {} -const generator: Types.CodeGenerator.GenerateFunction