Skip to content

Commit

Permalink
Bump @types/node from 20.14.2 to 20.14.9 (#122)
Browse files Browse the repository at this point in the history
* Bump @types/node from 20.14.2 to 20.14.9

* Rename hook

* Cleanup
  • Loading branch information
fabasoad authored Jun 30, 2024
1 parent ba59115 commit 2c61ec8
Show file tree
Hide file tree
Showing 11 changed files with 470 additions and 1,184 deletions.
2 changes: 0 additions & 2 deletions .eslintignore

This file was deleted.

32 changes: 0 additions & 32 deletions .eslintrc.json

This file was deleted.

47 changes: 4 additions & 43 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,50 +8,11 @@ on: # yamllint disable-line rule:truthy
- main

jobs:
eslint:
name: ESLint
runs-on: ubuntu-latest
steps:
- name: Checkout ${{ github.repository }}
uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v4
with:
node-version-file: ".tool-versions"
- name: Cache yarn dependencies
id: yarn-cache
uses: actions/cache@v4
with:
path: |
.yarn/cache
node_modules
key: "${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('**/.yarnrc.yml') }}"
restore-keys: |
${{ runner.os }}-yarn-
- name: Compile
if: ${{ steps.yarn-cache.outputs.cache-hit != 'true' }}
run: yarn install
- name: Run ESLint
uses: sibiraj-s/action-eslint@v3
with:
all-files: "true"
ignore-patterns: |
.github
.yarn
coverage
dist
node_modules
eslint-args: "-o eslint-results.sarif -f ${{ github.workspace }}/node_modules/@microsoft/eslint-formatter-sarif/sarif.js"
extensions: "js,jsx,ts,tsx"
annotations: true
- name: Upload to GHAS
if: always()
uses: github/codeql-action/upload-sarif@v3
with:
category: "eslint"
sarif_file: "eslint-results.sarif"
js-lint:
name: JS Lint
uses: fabasoad/reusable-workflows/.github/workflows/wf-js-lint.yml@main
pre-commit:
name: Pre-commit
uses: fabasoad/reusable-workflows/.github/workflows/wf-pre-commit.yml@main
with:
skip-hooks: "audit, build, eslint, test, snyk-test"
skip-hooks: "audit, build, lint, test, snyk-test, grype-dir"
4 changes: 2 additions & 2 deletions .gitleaksignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
.yarn/releases/yarn-4.3.0.cjs:aws-access-token:149
.yarn/releases/yarn-4.3.0.cjs:generic-api-key:567
.yarn/releases/yarn-4.3.1.cjs:aws-access-token:149
.yarn/releases/yarn-4.3.1.cjs:generic-api-key:567
13 changes: 11 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ repos:
pass_filenames: false
verbose: true
stages: ["push"]
- id: eslint
- id: lint
name: Lint
entry: yarn run lint
language: system
Expand Down Expand Up @@ -48,6 +48,15 @@ repos:
hooks:
- id: snyk-test
stages: ["push"]
- repo: https://github.com/fabasoad/pre-commit-grype
rev: v0.3.1
hooks:
- id: grype-dir
args:
- --hook-args=--log-level debug
- --grype-args=--fail-on low
- --grype-args=--by-cve
stages: ["push"]
# Markdown
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.41.0
Expand All @@ -66,7 +75,7 @@ repos:
hooks:
- id: actionlint
args: ["-pyflakes="]
stages: ["push"]
stages: ["commit"]
# Other
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
Expand Down
434 changes: 217 additions & 217 deletions .yarn/releases/yarn-4.3.0.cjs → .yarn/releases/yarn-4.3.1.cjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-4.3.0.cjs
yarnPath: .yarn/releases/yarn-4.3.1.cjs
81 changes: 81 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
{
"linter": {
"enabled": true,
"rules": {
"recommended": false,
"a11y": { "noBlankTarget": "error" },
"complexity": {
"noExtraBooleanCast": "error",
"noMultipleSpacesInRegularExpressionLiterals": "error",
"noUselessCatch": "error",
"noWith": "error"
},
"correctness": {
"noChildrenProp": "error",
"noConstAssign": "error",
"noConstantCondition": "error",
"noEmptyCharacterClassInRegex": "error",
"noEmptyPattern": "error",
"noGlobalObjectCalls": "error",
"noInnerDeclarations": "error",
"noInvalidConstructorSuper": "error",
"noNewSymbol": "error",
"noNonoctalDecimalEscape": "error",
"noPrecisionLoss": "error",
"noSelfAssign": "error",
"noSetterReturn": "error",
"noSwitchDeclarations": "error",
"noUndeclaredVariables": "error",
"noUnreachable": "error",
"noUnreachableSuper": "error",
"noUnsafeFinally": "error",
"noUnsafeOptionalChaining": "error",
"noUnusedLabels": "error",
"noUnusedVariables": "off",
"useIsNan": "error",
"useJsxKeyInIterable": "error",
"useValidForDirection": "error",
"useYield": "error"
},
"security": { "noDangerouslySetInnerHtml": "error" },
"style": {
"noArguments": "error",
"noVar": "error",
"useBlockStatements": "error",
"useConst": "error",
"useSingleVarDeclarator": "error"
},
"suspicious": {
"noAsyncPromiseExecutor": "error",
"noCatchAssign": "error",
"noClassAssign": "error",
"noCommentText": "error",
"noCompareNegZero": "error",
"noControlCharactersInRegex": "error",
"noDebugger": "error",
"noDuplicateCase": "error",
"noDuplicateClassMembers": "error",
"noDuplicateJsxProps": "error",
"noDuplicateObjectKeys": "error",
"noDuplicateParameters": "error",
"noEmptyBlockStatements": "error",
"noFallthroughSwitchClause": "error",
"noFunctionAssign": "error",
"noGlobalAssign": "error",
"noImportAssign": "error",
"noMisleadingCharacterClass": "error",
"noPrototypeBuiltins": "error",
"noRedeclare": "error",
"noShadowRestrictedNames": "error",
"noUnsafeNegation": "error",
"useGetterReturn": "error",
"useValidTypeof": "error"
}
},
"ignore": ["dist/**"]
},
"javascript": {
"globals": ["Atomics", "SharedArrayBuffer", "jest", "afterEach", "beforeAll", "beforeEach", "expect", "test", "describe"]
},
"overrides": [{ "include": ["**/*.spec.ts", "**/*.spec.tsx"] }]
}
16 changes: 6 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nsfw-detection-action",
"version": "2.0.3",
"version": "2.0.4",
"description": "This GitHub action detects nsfw content in committed files.",
"main": "dist/index.js",
"repository": {
Expand All @@ -9,7 +9,7 @@
},
"scripts": {
"build": "ncc build -m src/index.ts",
"lint": "eslint --ext ts src",
"lint": "biome lint --write src",
"test": "jest --config=jest.config.json --coverage"
},
"keywords": [
Expand All @@ -25,22 +25,18 @@
"winston": "3.13.0"
},
"devDependencies": {
"@microsoft/eslint-formatter-sarif": "3.1.0",
"@biomejs/biome": "1.8.3",
"@octokit/types": "12.6.0",
"@types/chai": "4.3.16",
"@types/glob": "8.1.0",
"@types/jest": "29.5.12",
"@types/node": "20.14.2",
"@typescript-eslint/eslint-plugin": "7.13.0",
"@typescript-eslint/parser": "7.13.0",
"@types/node": "20.14.9",
"@vercel/ncc": "0.38.1",
"eslint": "8.57.0",
"eslint-config-google": "0.14.0",
"jest": "29.7.0",
"jest-circus": "29.7.0",
"mocha-param": "2.0.1",
"ts-jest": "29.1.5",
"typescript": "5.4.5"
"typescript": "5.5.2"
},
"packageManager": "yarn@4.3.0"
"packageManager": "yarn@4.3.1"
}
12 changes: 6 additions & 6 deletions src/__tests__/translation/NsfwDetectionProviderFactory.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ describe(NsfwDetectionProviderFactory.name, () => {
paramName: 'sightengine'
}
]
itParam('should return ${value.className} instance', fixture,
(value: NsfwDetectionProviderFactorySpecFixture) => {
test.each(fixture)('should return $className instance',
({ className, paramName }: NsfwDetectionProviderFactorySpecFixture) => {
const provider: INsfwDetectionProvider =
NsfwDetectionProviderFactory.getProvider(value.paramName)
expect(provider.constructor.name).toBe(value.className)
NsfwDetectionProviderFactory.getProvider(paramName)
expect(provider.constructor.name).toBe(className)
})
it('should throw error', () => {
test('should throw error', () => {
const name = 'randomstring'
expect(() => NsfwDetectionProviderFactory.getProvider(name))
.toThrowError(`${name} provider is not supported`)
.toThrow(`${name} provider is not supported`)
});
})
Loading

0 comments on commit 2c61ec8

Please sign in to comment.