Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .eslintignore

This file was deleted.

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

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v5

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/pull-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,20 @@ jobs:
commitlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v5
with:
fetch-depth: 0
- uses: actions/setup-node@v3
- uses: actions/setup-node@v5
with:
node-version: 18.x
node-version: 20.x
- run: npm i
- run: npx commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose
main:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v5
- uses: actions/setup-node@v5
with:
node-version: 18.x
node-version: 20.x
- run: npm i
- run: npm test
11 changes: 8 additions & 3 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,23 @@ on:
branches:
- 'master'

permissions:
id-token: write # Required for OIDC
contents: read

jobs:
main:
runs-on: ubuntu-latest
environment: DeployEnv
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v5
with:
fetch-depth: 0
- uses: actions/setup-node@v3
- uses: actions/setup-node@v5
with:
node-version: 18
node-version: 20
- name: Update npm
run: npm install -g npm@latest
- run: npm i
- run: npm test
- name: Release
Expand Down
126 changes: 126 additions & 0 deletions eslint.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
import path from 'node:path';

import { includeIgnoreFile } from '@eslint/compat';
import js from '@eslint/js';
import { configs, plugins } from 'eslint-config-airbnb-extended';
import { type Linter } from 'eslint';

const gitignorePath = path.resolve('.', '.gitignore');

const jsConfig = [
// ESLint Recommended Rules
{
name: 'js/config',
...js.configs.recommended,
},
// Stylistic Plugin
plugins.stylistic,
// Typescript Plugin
plugins.typescriptEslint,
// Import X Plugin
plugins.importX,
// Airbnb Base Recommended Config
...configs.base.recommended,
];

const nodeConfig = [
// Node Plugin
plugins.node,
// Airbnb Node Recommended Config
...configs.node.recommended,
];

const typescriptConfig = [
// TypeScript ESLint Plugin
plugins.typescriptEslint,
// Airbnb Base TypeScript Config
...configs.base.typescript,
];

// Equivalent to airbnb-base
const config: Linter.Config[] = [
// Ignore .gitignore files/folder in eslint
includeIgnoreFile(gitignorePath),
// Javascript Config
...jsConfig,
// Node Config
...nodeConfig,
// TypeScript Config
...typescriptConfig,
{
rules: {
'func-names': 'off',
'prefer-object-spread': 'off',
'import-x/prefer-default-export': 'off',
'import-x/extensions': 'off',
'import-x/no-unresolved': 'off',
'import-x/no-extraneous-dependencies': 'off',
'class-methods-use-this': 'off',
'no-await-in-loop': 'off',
eqeqeq: 'off',
'no-restricted-syntax': 'off',
'@stylistic/max-len': ['error', { code: 200 }],
},
},
{
files: ['**/*.ts'],
rules: {
// BEGIN ERRORS
'@typescript-eslint/no-non-null-assertion': 'error',
'@typescript-eslint/no-require-imports': 'error',
'@typescript-eslint/no-unused-vars': 'error',
'@typescript-eslint/restrict-template-expressions': [
'error',
{ allowNumber: true, allowBoolean: true, allowNullish: true },
],
'@typescript-eslint/restrict-plus-operands': [
'error',
{ skipCompoundAssignments: true },
],

// This prevents declarations like `interface ISomething { ... }`
'@typescript-eslint/naming-convention': [
'error',
{
selector: 'interface',
format: ['PascalCase'],
custom: {
regex: '^I[A-Z]',
match: false,
},
},
],

// BEGIN DISABLED. Some of these are disabled just to prevent warnings.
'@typescript-eslint/explicit-member-accessibility': 'off',
'@typescript-eslint/no-unnecessary-type-assertion': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/unbound-method': 'off',
'@typescript-eslint/ban-types': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-unsafe-return': 'off',
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/no-redundant-type-constituents': 'off',
},
},
{
files: [
'test/**/*.{ts,tsx}',
'*.test.{ts,tsx}',
],
rules: {
// Allow ! in tests.
'@typescript-eslint/no-non-null-assertion': 'off',

// Allow tests to create odd string templates if they want.
'@typescript-eslint/restrict-template-expressions': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
},
},
];

export default config;
33 changes: 0 additions & 33 deletions jest.config.js

This file was deleted.

35 changes: 18 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
"src/**/*.d.ts"
],
"engines": {
"node": ">=14",
"npm": ">=2.14.7"
"node": ">=20"
},
"scripts": {
"lint": "eslint . --cache",
Expand All @@ -35,25 +34,27 @@
"@aws-sdk/util-dynamodb": "^3.137.0",
"@commitlint/cli": "^17.8.0",
"@commitlint/config-conventional": "^17.8.0",
"@eslint/compat": "^1.3.2",
"@eslint/js": "^9.35.0",
"@stylistic/eslint-plugin": "^3.1.0",
"@types/debug": "^4.1.9",
"@types/node": "^18.18.5",
"@typescript-eslint/eslint-plugin": "^6.7.5",
"@typescript-eslint/parser": "^6.7.5",
"@vitest/coverage-v8": "^0.34.6",
"aws-sdk-client-mock": "^3.0.0",
"@types/node": "^22.18.1",
"@vitest/coverage-v8": "^3.2.4",
"aws-sdk-client-mock": "^3.1.0",
"conventional-changelog-conventionalcommits": "^7.0.2",
"eslint": "^8.51.0",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-config-airbnb-typescript": "^17.1.0",
"eslint-plugin-chai-expect": "^3.0.0",
"eslint-plugin-import": "^2.28.1",
"eslint-plugin-jest": "^27.4.2",
"eslint-plugin-jsx-a11y": "^6.7.1",
"eslint-plugin-react": "^7.33.2",
"eslint": "^9.35.0",
"eslint-config-airbnb-extended": "^2.2.0",
"eslint-import-resolver-typescript": "^4.4.4",
"eslint-plugin-import": "^2.32.0",
"eslint-plugin-import-x": "^4.16.1",
"eslint-plugin-jsx-a11y": "^6.10.2",
"eslint-plugin-n": "^17.21.3",
"husky": "^8.0.3",
"jiti": "^2.5.1",
"lint-staged": "^15.0.1",
"typescript": "^5.2.2",
"vitest": "^0.34.6"
"typescript": "^5.9.2",
"typescript-eslint": "^8.42.0",
"vitest": "^3.2.4"
},
"dependencies": {
"@aws-sdk/client-dynamodb": "^3.137.0",
Expand Down
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ export class CredStash {

async incrementVersion(opts: NameOpts) {
const rawVersion = await this.getHighestVersion(opts);
// eslint-disable-next-line @typescript-eslint/no-unnecessary-template-expression
if (`${rawVersion}`.match(/^[0-9]+$/)) {
const version = Number.parseInt(rawVersion, 10) + 1;
return paddedInt(version);
Expand Down
Loading