Skip to content
2 changes: 1 addition & 1 deletion biome.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
"./src/erasableSyntax.jsonc"
],
"files": {
"include": ["src/", "test/*.ts"]
"includes": ["**/src/**", "**/test/**/*.ts"]
}
}
17 changes: 4 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,7 @@
"lint": "biome check",
"lint:fix": "biome check --write"
},
"keywords": [
"biomejs",
"linting",
"formatting"
],
"keywords": ["biomejs", "linting", "formatting"],
"type": "module",
"exports": {
".": "./src/index.jsonc",
Expand All @@ -29,16 +25,11 @@
"./erasable-syntax": "./src/erasableSyntax.jsonc",
"./eraseable-syntax": "./src/erasableSyntax.jsonc"
},
"files": [
"src",
"LICENSE",
"README.md",
"CHANGELOG.md"
],
"files": ["src", "LICENSE", "README.md", "CHANGELOG.md"],
"devDependencies": {
"@biomejs/biome": "^1.9.4"
"@biomejs/biome": "^2.2.0"
},
"peerDependencies": {
"@biomejs/biome": "^1.9.4"
"@biomejs/biome": "^2.2.0"
}
}
46 changes: 26 additions & 20 deletions src/erasableSyntax.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
"$schema": "../node_modules/@biomejs/biome/configuration_schema.json",
"linter": {
"rules": {
// TODO: Need to add a rule to restrict use of accessibility in constructor
"suspicious": {
"style": {
// In Typescript erasable syntax enums are not allowed
// https://www.typescriptlang.org/tsconfig/#erasableSyntaxOnly
"noConstEnum": "error"
"noEnum": "error"
},
"nursery": {
// TODO: Need to add a rule to restrict use of accessibility in constructor
"suspicious": {
// In Typescript erasable syntax enums are not allowed
// https://www.typescriptlang.org/tsconfig/#erasableSyntaxOnly
"noEnum": "error"
"noConstEnum": "error"
}
}
},
Expand All @@ -20,37 +20,43 @@
// properties should be reflected as PascalCase style as for enum
// We can not override one style so have to add the full rule
{
"include": ["*"],
"includes": ["**/*"],
"linter": {
"rules": {
"style": {
"useNamingConvention": {
"level": "error",
"options": {
// It is common to use two consecutive capital case letters e.g. HTTPServer
// this option when set to true does not allow
"strictCase": false,
// Unicode characters are supported by IDEs but when used in variables
// code looks from another planet, so must be read by aliens
"requireAscii": true,
"conventions": [
{
"formats": ["PascalCase"],
"match": "(.+)Enum|[a-z][a-zA-Z0-9_]*",
// We want all enum variables to be prefixed by `Enum`
// Only then allow variable to be PascalCase
"selector": { "kind": "const" },
"match": "(.+)Enum|[a-z][a-zA-Z0-9_]*",
"formats": ["PascalCase"]
"selector": {
"kind": "const"
}
},
{
"selector": { "kind": "variable" },
"formats": ["PascalCase"],
"match": "(.+)Enum|[a-z][a-zA-Z0-9_]*",
"formats": ["PascalCase"]
"selector": {
"kind": "variable"
}
},
{
"selector": { "kind": "objectLiteralProperty" },
"formats": ["PascalCase", "camelCase"]
"formats": ["PascalCase", "camelCase"],
"selector": {
"kind": "objectLiteralProperty"
}
}
]
],
// Unicode characters are supported by IDEs but when used in variables
// code looks from another planet, so must be read by aliens
"requireAscii": true,
// It is common to use two consecutive capital case letters e.g. HTTPServer
// this option when set to true does not allow
"strictCase": false
}
}
}
Expand Down
5 changes: 3 additions & 2 deletions src/esm.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
"$schema": "../node_modules/@biomejs/biome/configuration_schema.json",
"linter": {
"rules": {
"nursery": {
"style": {
"noCommonJs": "error"
}
}
}
},
"root": false
}
103 changes: 75 additions & 28 deletions src/index.jsonc
Original file line number Diff line number Diff line change
@@ -1,52 +1,99 @@
{
"$schema": "../node_modules/@biomejs/biome/configuration_schema.json",
"vcs": {
"clientKind": "git",
"enabled": true,
"useIgnoreFile": true
"assist": {
"actions": {
"recommended": true,
"source": {
"organizeImports": {
"level": "on",
"options": {
"groups": [
// TODO: Make sure to not enforce type for import/exports
// { "type": false },
[
// Bun modules
":BUN:",
// Node.js modules
":NODE:"
],
":BLANK_LINE:",
[
// Modules imported with the `npm:` protocol
"npm:*",
"npm:*/**",
// Modules imported with another protocol. e.g. `jsr:`
":PACKAGE_WITH_PROTOCOL:"
],
":BLANK_LINE:",
["@chainsafe/**", "@lodestar/**"],
":BLANK_LINE:",
[
// URLs
":URL:",
// Libraries
":PACKAGE:"
],
":BLANK_LINE:",
// Sharp aliases
[":ALIAS:"],
":BLANK_LINE:",
// Absolute paths
["/**"],
":BLANK_LINE:",
// All other paths
":PATH:"
]
}
}
}
}
},
"files": {
"includes": ["!**/.nyc_output", "!**/node_modules", "!**/coverage/**/*"]
},
"formatter": {
"enabled": true,
"formatWithErrors": true,
"useEditorconfig": true,
"lineWidth": 120,
"attributePosition": "auto",
"bracketSpacing": false,
"enabled": true,
"formatWithErrors": true,
"indentStyle": "space",
"indentWidth": 2,
"lineEnding": "lf",
"ignore": ["**/lib", "**/.nyc_output", "./packages/*/spec-tests", "**/node_modules"]
},
"organizeImports": {
"enabled": true
},
"linter": {
"enabled": true,
"rules": {
"recommended": true
}
"lineWidth": 120,
"useEditorconfig": true
},
"javascript": {
"formatter": {
"jsxQuoteStyle": "double",
"quoteProperties": "asNeeded",
"trailingCommas": "es5",
"semicolons": "always",
"arrowParentheses": "always",
"bracketSpacing": false,
"attributePosition": "auto",
"bracketSameLine": false,
"bracketSpacing": false,
"enabled": true,
"jsxQuoteStyle": "double",
"quoteProperties": "asNeeded",
"quoteStyle": "double",
"attributePosition": "auto",
"enabled": true
},
"linter": {
"enabled": true
"semicolons": "always",
"trailingCommas": "es5"
},
"globals": ["BigInt"]
},
"json": {
"formatter": {
"bracketSpacing": true,
"expand": "auto",
"trailingCommas": "none"
}
},
"linter": {
"enabled": true,
"rules": {
"recommended": true
}
},
"root": false,
"vcs": {
"clientKind": "git",
"enabled": true,
"useIgnoreFile": true
}
}
7 changes: 4 additions & 3 deletions src/nodejs.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "../node_modules/@biomejs/biome/configuration_schema.json",
"linter": {
"rules": {
"nursery": {
"style": {
"noRestrictedImports": {
"level": "error",
"options": {
Expand All @@ -15,13 +15,14 @@
"os": "Please use node:os instead.",
"path": "Please use node:path instead.",
"stream": "Please use node:stream instead.",
"util": "Please use node:util instead.",
"url": "Please use node:url instead.",
"util": "Please use node:util instead.",
"worker_threads": "Please use node:worker_threads instead."
}
}
}
}
}
}
},
"root": false
}
Loading