Skip to content

Commit d285757

Browse files
committed
Normalize configs, linting, etc.
1 parent dc34e53 commit d285757

23 files changed

+40263
-36419
lines changed

.editorconfig

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
root = true
22

33
[*]
4+
charset = utf-8
45
end_of_line = lf
5-
insert_final_newline = true
6-
indent_style = space
76
indent_size = 2
8-
charset = utf-8
7+
indent_style = space
8+
insert_final_newline = true
9+
max_line_length = 80
910
trim_trailing_whitespace = true

.eslintignore

Lines changed: 0 additions & 3 deletions
This file was deleted.

.eslintrc

Lines changed: 0 additions & 18 deletions
This file was deleted.

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* text=auto eol=lfs

.ncurc.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"loglevel": "minimal",
3+
"reject": ["eslint-plugin-unicorn"],
4+
"upgrade": true
5+
}

.oxlintignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
openapi.json
2+
package-lock.json

.oxlintrc.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"$schema": "./node_modules/oxlint/configuration_schema.json",
3+
"plugins": ["import", "promise", "typescript", "unicorn"],
4+
"categories": {
5+
"correctness": "warn",
6+
"perf": "warn",
7+
"suspicious": "warn"
8+
},
9+
"settings": {},
10+
"rules": {
11+
"@typescript-eslint/array-type": ["error", { "default": "array-simple" }],
12+
"@typescript-eslint/no-misused-new": "error",
13+
"@typescript-eslint/no-this-alias": [
14+
"error",
15+
{ "allowDestructuring": true }
16+
],
17+
"@typescript-eslint/return-await": ["error", "always"],
18+
"no-control-regex": "off",
19+
"no-new": "off",
20+
"no-self-assign": "off",
21+
"no-undef": "off",
22+
"no-unused-vars": "off",
23+
"no-var": "error",
24+
"unicorn/no-empty-file": "off",
25+
"unicorn/no-new-array": "off"
26+
}
27+
}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ const { SocketSdk } = require('@socketsecurity/sdk')
4848

4949
### Report methods
5050

51-
* `createReportFromFilePaths(filePaths, pathsRelativeTo=., [issueRules])`
51+
* `createReportFromFilepaths(filePaths, pathsRelativeTo=., [issueRules])`
5252
* `filePaths`: An `array` of absolute or relative `string` paths to `package.json` and any corresponding `package-lock.json` files
5353
* `pathsRelativeTo`: A `string` path that the absolute paths `filePaths` are relative to. This to calculate where in your project the `package.json`/`package-lock.json` files lives
5454
* `issueRules`: An object that follows the format of the [`socket.yml`](https://docs.socket.dev/docs/socket-yml) issue rules. Keys being issue names, values being a boolean that activates or deactivates it. Is applied on top of default config and organization config.

biome.json

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
{
2+
"$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
3+
"files": {
4+
"ignore": [
5+
"**/.git",
6+
"**/.github",
7+
"**/.husky",
8+
"**/.tap",
9+
"**/.type-coverage",
10+
"**/.vscode",
11+
"**/coverage",
12+
"**/dist",
13+
"**/package.json",
14+
"**/package-lock.json",
15+
"openapi.json"
16+
],
17+
"maxSize": 5242880
18+
},
19+
"formatter": {
20+
"enabled": true,
21+
"attributePosition": "auto",
22+
"bracketSpacing": true,
23+
"formatWithErrors": false,
24+
"indentStyle": "space",
25+
"indentWidth": 2,
26+
"lineEnding": "lf",
27+
"lineWidth": 80,
28+
"useEditorconfig": true
29+
},
30+
"javascript": {
31+
"formatter": {
32+
"arrowParentheses": "asNeeded",
33+
"attributePosition": "auto",
34+
"bracketSameLine": false,
35+
"bracketSpacing": true,
36+
"jsxQuoteStyle": "double",
37+
"quoteProperties": "asNeeded",
38+
"quoteStyle": "single",
39+
"semicolons": "asNeeded",
40+
"trailingCommas": "none"
41+
}
42+
},
43+
"json": {
44+
"formatter": {
45+
"enabled": true,
46+
"trailingCommas": "none"
47+
},
48+
"parser": {
49+
"allowComments": true,
50+
"allowTrailingCommas": true
51+
}
52+
}
53+
}

build/generate-types.js

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,20 @@
22

33
const path = require('node:path')
44

5-
Promise.resolve().then(async () => {
6-
const { default: openapiTS } = await import('openapi-typescript')
7-
8-
const localPath = path.resolve(__dirname, '../openapi.json')
9-
const output = await openapiTS(localPath, {
10-
transform (schemaObject) {
11-
if ('format' in schemaObject && schemaObject.format === 'binary') {
12-
return 'never'
5+
void (async () => {
6+
try {
7+
const { default: openapiTS } = await import('openapi-typescript')
8+
const localPath = path.join(__dirname, '../openapi.json')
9+
const output = await openapiTS(localPath, {
10+
transform(schemaObject) {
11+
if ('format' in schemaObject && schemaObject.format === 'binary') {
12+
return 'never'
13+
}
1314
}
14-
}
15-
})
16-
17-
// eslint-disable-next-line no-console
18-
console.log(output)
19-
}).catch(err => {
20-
// eslint-disable-next-line no-console
21-
console.error('Failed with error:', err.stack)
22-
process.exit(1)
23-
})
15+
})
16+
console.log(output)
17+
} catch (e) {
18+
process.exitCode = 1
19+
console.error('Failed with error:', e)
20+
}
21+
})()

0 commit comments

Comments
 (0)