Skip to content

Commit

Permalink
chore: small changes
Browse files Browse the repository at this point in the history
* update default eslint config to disable various rules as per typescript-eslint recommendation
* add new eslint config to run with ci
* add script to package.json to run CI specific linting
* update CI to lint first and only run build on successful linting

Signed-off-by: eXhumer <[email protected]>
  • Loading branch information
eXhumer committed Nov 7, 2024
1 parent ea09975 commit c3a86ce
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 1 deletion.
23 changes: 23 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,30 @@ on:
workflow_dispatch:

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

- name: Enable Corepack
run: corepack enable

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
check-latest: true
cache: 'yarn'

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

- name: Run lint
run: yarn lint:ci

build-matrix:
needs: lint
strategy:
matrix:
image: [
Expand Down
26 changes: 26 additions & 0 deletions eslint.config.ci.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import js from '@eslint/js';
import tseslint from 'typescript-eslint';
import importPlugin from 'eslint-plugin-import';

export default [
{
ignores: [
'.venv/*',
'.webpack/*',
],
},
js.configs.recommended,
...tseslint.configs.recommended,
importPlugin.flatConfigs.recommended,
importPlugin.flatConfigs.electron,
importPlugin.flatConfigs.typescript,
{
rules: {
'import/named': 'off',
'import/namespace': 'off',
'import/default': 'off',
'import/no-named-as-default-member': 'off',
'import/no-unresolved': 'off',
},
},
];
15 changes: 14 additions & 1 deletion eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,26 @@ import importPlugin from 'eslint-plugin-import';
export default [
{
ignores: [
'.venv/*',
'.webpack/*',
'eslint.config.mjs'
],
},
js.configs.recommended,
...tseslint.configs.recommended,
importPlugin.flatConfigs.recommended,
importPlugin.flatConfigs.electron,
importPlugin.flatConfigs.typescript,
{
rules: {
'import/named': 'off',
'import/namespace': 'off',
'import/default': 'off',
'import/no-named-as-default-member': 'off',
'import/no-unresolved': 'off',
'import/no-named-as-default': 'off',
'import/no-cycle': 'off',
'import/no-unused-modules': 'off',
'import/no-deprecated': 'off',
},
},
];
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"make": "electron-forge make",
"publish": "electron-forge publish",
"lint": "eslint",
"lint:ci": "yarn lint:scss && eslint --config eslint.config.ci.mjs",
"lint:scss": "stylelint \"src/**/*.scss\"",
"patch-dev": " yarn redeploy-electron-dev && yarn vmp-sign-dev",
"redeploy-electron-dev": "ts-node scripts/redeploy-electron-dev.ts",
Expand Down

0 comments on commit c3a86ce

Please sign in to comment.