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
30 changes: 30 additions & 0 deletions .github/actions/lint-test-build/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: 'Lint, Test, Build'
description: 'Run linting, tests, and build'
inputs:
node-version:
description: 'Node.js version to use'
required: false
default: '22'
runs:
using: 'composite'
steps:
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node-version }}

- name: Install dependencies
shell: bash
run: npm ci

- name: Lint
shell: bash
run: npm run lint

- name: Test
shell: bash
run: npm run test

- name: Build
shell: bash
run: npm run build
37 changes: 37 additions & 0 deletions .github/workflows/verify-pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Verify Pull Request

on:
pull_request:
branches:
- develop
push:
branches:
- develop

jobs:
ci:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Lint, Test, Build
uses: ./.github/actions/lint-test-build
with:
node-version: '22'

security-scan:
runs-on: ubuntu-latest
permissions:
security-events: write
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Initialize CodeQL
uses: github/codeql-action/init@v4
with:
languages: javascript

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v4
6 changes: 6 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"singleQuote": true,
"trailingComma": "all",
"semi": true,
"tabWidth": 2
}
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ A browser extension that filters out watched and members-only YouTube videos, ke

## Development

- Clone this repository.
- run: `npm i`
- git clone this repository.
- run `npm i`
- run `npm start` or `./ddstart` for docker-desktop on Linux
- Load the extension in your browser:
- Firefox: Go to `about:debugging#/runtime/this-firefox` and select "Load Temporary Add-on."
Expand All @@ -33,6 +33,7 @@ A browser extension that filters out watched and members-only YouTube videos, ke

## Manual Build Pipeline (for extension developers)

- Create a pull request to merge your `feature` branch into `develop` branch
- Create `release/v<version>` off `develop` branch
- Update `version` in `package.json`, `manifest.json`, `CHANGELOG.md`
- Run `npm install` to update the version in `package-lock.json`
Expand Down
53 changes: 53 additions & 0 deletions eslint.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import js from '@eslint/js';
import globals from 'globals';
import typescriptEslint from 'typescript-eslint';
import pluginReact from 'eslint-plugin-react';
import { Config, defineConfig, globalIgnores } from 'eslint/config';
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';

const reactConfig: Config = {
name: 'react',
...pluginReact.configs.flat.recommended,
settings: {
react: {
version: 'detect',
},
},
};

const customConfig: Config = {
name: 'custom',
languageOptions: {
parser: typescriptEslint.parser,
parserOptions: {
project: './tsconfig.eslint.json',
},
globals: {
...globals.browser /* for: 'window' is not defined no-undef */,
...globals.webextensions /* for: 'browser' is not defined no-undef */,
...globals.node /* for: 'process' is not defined no-undef */,
NodeJS: true /* for: 'NodeJS' is not defined no-undef */,
},
},
/* no need for registering `plugins: { '@typescript-eslint': typescriptEslintPlugin, prettier: eslintPluginPrettier }` in order to use `rules`, as those plugins are already included in their respective config objects */
rules: {
'prettier/prettier':
'error' /* makes any Prettier violation an error, and eslint --fix runs Prettier to resolve it. */,
'no-case-declarations': 'off',
'react/react-in-jsx-scope': 'off',
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/no-explicit-any': 'off',
},
};

export default defineConfig([
globalIgnores(['watch-output', 'build-output']),
{ name: 'js/recommended', ...js.configs.recommended },
typescriptEslint.configs
.recommended /* sets default TS rules, and registers @typescript-eslint as a plugin, so rules such as '@typescript-eslint/no-unused-vars' can be used in configs, without adding `plugins: {'@typescript-eslint': typescriptEslintPlugin}` in those configs */,
reactConfig,
customConfig,
eslintPluginPrettierRecommended /* enables the eslint-config-prettier config which will turn off ESLint rules that conflict with Prettier, via prettier/prettier rule */,
]);
Loading