Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
Signed-off-by: Clemens Vasters <clemens@vasters.com>
  • Loading branch information
clemensv committed Sep 14, 2024
1 parent 8d8b1be commit d757f45
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 32 deletions.
2 changes: 1 addition & 1 deletion avrotize/avrotopython/enum_core.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ class {{ class_name }}(Enum):

if ordinal is None:
raise ValueError("ordinal must not be None")
{%- if ordinals | length > 0 %}
if isinstance(ordinal, str) and ordinal.isdigit():
ordinal = int(ordinal)
{%- if ordinals | length > 0 %}
if isinstance(ordinal, int):
{%- for sym, ord in ordinals.items() -%}
{%- if loop.first %}
Expand Down
30 changes: 0 additions & 30 deletions vscode/avrotize/.eslintrc.json

This file was deleted.

29 changes: 29 additions & 0 deletions vscode/avrotize/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import typescriptEslint from "@typescript-eslint/eslint-plugin";
import tsParser from "@typescript-eslint/parser";

export default [{
ignores: ["**/out", "**/dist", "**/*.d.ts"],
}, {
plugins: {
"@typescript-eslint": typescriptEslint,
},

languageOptions: {
parser: tsParser,
ecmaVersion: 6,
sourceType: "module",
},

rules: {
"@typescript-eslint/naming-convention": ["warn", {
selector: "import",
format: ["camelCase", "PascalCase"],
}],

"@typescript-eslint/semi": "warn",
curly: "warn",
eqeqeq: "warn",
"no-throw-literal": "warn",
semi: "off",
},
}];
2 changes: 1 addition & 1 deletion vscode/avrotize/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@
"watch-tests": "tsc -p . -w --outDir out",
"pretest": "npm run compile-tests && npm run compile && npm run lint",
"check-types": "tsc --noEmit",
"lint": "eslint src",
"lint": "eslint",
"test": "vscode-test",
"deploy": "vsce publish --no-yarn"
},
Expand Down

0 comments on commit d757f45

Please sign in to comment.