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
6 changes: 3 additions & 3 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "thetvdb Dev Container",
"name": "thetvdb",
"image": "mcr.microsoft.com/devcontainers/base:jammy",
"features": {
"ghcr.io/devcontainers/features/node:1": {
"nodeGypDependencies": true,
"version": "20.12.2",
"version": "22.14.0",
"nvmVersion": "latest"
}
},
Expand All @@ -23,5 +23,5 @@
]
}
},
"postCreateCommand": "corepack enable && pnpm install"
"postCreateCommand": "npm i -g corepack@latest && corepack enable && corepack pnpm install"
}
17 changes: 0 additions & 17 deletions .eslintrc.cjs

This file was deleted.

2 changes: 1 addition & 1 deletion .github/labeler.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@
- changed-files:
- any-glob-to-any-file:
- ".prettierrc"
- ".eslintrc.cjs"
- "eslint.config.js"
33 changes: 9 additions & 24 deletions .github/workflows/cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,21 @@ on:
branches:
- main

env:
PNPM_VERSION: 9.0.6

jobs:
lint:
name: ⬣ Lint
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4.1.1
uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v3.0.0
with:
version: ${{ env.PNPM_VERSION }}

uses: pnpm/action-setup@v4
- name: Setup Node
uses: actions/setup-node@v4.0.2
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
cache: pnpm

- name: Install dependencies
run: pnpm install
- name: Run lint
Expand All @@ -35,19 +28,15 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4.1.1
uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v3.0.0
with:
version: ${{ env.PNPM_VERSION }}

uses: pnpm/action-setup@v4
- name: Setup Node
uses: actions/setup-node@v4.0.2
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
cache: pnpm

- name: Install dependencies
run: pnpm install
- name: Run tests
Expand All @@ -58,19 +47,15 @@ jobs:
needs: [lint, test]
steps:
- name: Checkout repo
uses: actions/checkout@v4.1.1
uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v3.0.0
with:
version: ${{ env.PNPM_VERSION }}

uses: pnpm/action-setup@v4
- name: Setup Node
uses: actions/setup-node@v4.0.2
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
cache: pnpm

- name: Install dependencies
run: pnpm install
- name: Run build
Expand Down
31 changes: 9 additions & 22 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,18 @@ on:
branches:
- main

env:
PNPM_VERSION: 9.0.6

jobs:
lint:
name: ⬣ Lint
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4.1.1
uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v3.0.0
with:
version: ${{ env.PNPM_VERSION }}

uses: pnpm/action-setup@v4
- name: Setup Node
uses: actions/setup-node@v4.0.2
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
cache: pnpm
Expand All @@ -38,15 +32,12 @@ jobs:
node-version: ["18.19.0", "20.11.0", "22.0.0"]
steps:
- name: Checkout repo
uses: actions/checkout@v4.1.1
uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v3.0.0
with:
version: ${{ env.PNPM_VERSION }}

uses: pnpm/action-setup@v4
- name: Setup Node
uses: actions/setup-node@v4.0.2
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: pnpm
Expand All @@ -61,19 +52,15 @@ jobs:
needs: [lint, test]
steps:
- name: Checkout repo
uses: actions/checkout@v4.1.1
uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v3.0.0
with:
version: ${{ env.PNPM_VERSION }}

uses: pnpm/action-setup@v4
- name: Setup Node
uses: actions/setup-node@v4.0.2
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
cache: pnpm

- name: Install dependencies
run: pnpm install
- name: Run build
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v4.1.1
uses: actions/checkout@v4
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/label.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ jobs:
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@v5.0.0
- uses: actions/labeler@v5
with:
configuration-path: .github/labeler.yaml
18 changes: 5 additions & 13 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ on:
branches:
- main

env:
PNPM_VERSION: 9.0.6

jobs:
release:
name: 🚀 Release
Expand All @@ -22,23 +19,18 @@ jobs:
id-token: write
steps:
- name: Checkout repo
uses: actions/checkout@v4.1.1
uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v3.0.0
with:
version: ${{ env.PNPM_VERSION }}

uses: pnpm/action-setup@v4
- name: Setup Node
uses: actions/setup-node@v4.0.2
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
cache: pnpm

- name: Install dependencies
run: pnpm install --frozen-lockfile

run: pnpm install
- name: Create Release Pull Request
uses: changesets/action@v1.4.7
uses: changesets/action@v1.4.10
with:
title: "chore(release): new @untidy/thetvdb version"
commit: "chore(release): publish new version"
Expand Down
8 changes: 3 additions & 5 deletions .github/workflows/static.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4.1.1
uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v3.0.0
with:
version: 9.0.6
uses: pnpm/action-setup@v4
- name: Setup Node
uses: actions/setup-node@v4.0.2
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
cache: pnpm
Expand Down
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@ node_modules
coverage
dist
.env
.temp
cache
.astro
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v20.12.2
v22.14.0
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
dist
pnpm-lock.yaml
.astro
CHANGELOG.md
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@ Monorepo containing tools for `TheTVDB API`.

## :package: Packages

| packages | Docs |
| :------------------------------------------------------- | :--------------------------------- |
| [@untidy/thetvdb](./packages/api/) | [Readme](./packages/api/README.md) |
| [eslint-config-untidy](./packages/eslint-config-untidy/) | `Internal` |
| [@untidy/thetvdb-docs](./packages/web/) | `Internal` |
| packages | Docs |
| :-------------------------------------- | :--------------------------------- |
| [@untidy/thetvdb](./packages/api/) | [Readme](./packages/api/README.md) |
| [@untidy/thetvdb-docs](./packages/web/) | `Internal` |

## :rocket: Contributing

Expand Down
87 changes: 87 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
import eslint from '@eslint/js';
import vitest from '@vitest/eslint-plugin';
import jsdoc from 'eslint-plugin-jsdoc';
import nodePlugin from 'eslint-plugin-n';
// @ts-expect-error: types doesn't exist
import pluginPromise from 'eslint-plugin-promise';
import tseslint from 'typescript-eslint';

export default tseslint.config(
eslint.configs.recommended,
{
plugins: { nodePlugin },
extends: [nodePlugin.configs['flat/recommended-module']],
rules: {
'n/no-unsupported-features/node-builtins': ['error', { ignores: ['fetch', 'import.meta.dirname'] }],
'n/no-missing-import': 'off',
},
},
pluginPromise.configs['flat/recommended'],
...tseslint.configs.strictTypeChecked,
...tseslint.configs.stylisticTypeChecked,
{ files: ['packages/api/tests/*.test.ts'], plugins: { vitest }, rules: { ...vitest.configs.recommended.rules } },
{
files: ['packages/api/src/*.ts'],
plugins: { jsdoc },
rules: {
'jsdoc/require-jsdoc': [
'error',
{ require: { ClassDeclaration: true, FunctionDeclaration: true, MethodDefinition: true } },
],
},
},
{
rules: {
'@typescript-eslint/no-use-before-define': [
'error',
{ functions: false, classes: false, enums: false, variables: false, typedefs: false },
],
'@typescript-eslint/return-await': ['error', 'always'],
'@typescript-eslint/consistent-type-exports': ['error', { fixMixedExportsWithInlineTypeSpecifier: true }],
'@typescript-eslint/consistent-type-imports': [
'error',
{ prefer: 'type-imports', disallowTypeAnnotations: true, fixStyle: 'inline-type-imports' },
],
'@typescript-eslint/explicit-function-return-type': [
'error',
{
allowExpressions: true,
allowHigherOrderFunctions: true,
allowTypedFunctionExpressions: true,
allowDirectConstAssertionInArrowFunctions: true,
},
],
'@typescript-eslint/method-signature-style': 'error',
'@typescript-eslint/naming-convention': [
'error',
{
selector: 'variableLike',
leadingUnderscore: 'allow',
trailingUnderscore: 'allow',
format: ['camelCase', 'PascalCase', 'UPPER_CASE'],
},
],
'@typescript-eslint/no-confusing-void-expression': [
'error',
{ ignoreArrowShorthand: false, ignoreVoidOperator: false },
],
'@typescript-eslint/prefer-readonly': 'error',
'@typescript-eslint/promise-function-async': 'error',
'@typescript-eslint/require-array-sort-compare': ['error', { ignoreStringArrays: true }],
'@typescript-eslint/strict-boolean-expressions': 'error',
'@typescript-eslint/no-import-type-side-effects': 'error',
'@typescript-eslint/restrict-template-expressions': 'off',
},
},
{
languageOptions: {
parserOptions: {
project: ['./tsconfig.json', './packages/*/tsconfig.json'],
tsconfigRootDir: import.meta.dirname,
ecmaVersion: 2023,
},
},
},
{ files: ['**/*.js'], ...tseslint.configs.disableTypeChecked },
{ ignores: ['**/dist/', 'packages/api/tests/*', 'packages/web/.astro/*', 'examples'] }
);
Loading