Skip to content
This repository has been archived by the owner on Oct 18, 2024. It is now read-only.

Unbitrot & Upgrade #147

Closed
wants to merge 20 commits into from
Closed
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
4 changes: 0 additions & 4 deletions .eslintignore

This file was deleted.

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

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
node-version: [20.x]

steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: macos-latest
strategy:
matrix:
node-version: [18.x]
node-version: [20.x]

steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 0 additions & 2 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

pnpx lint-staged
4 changes: 1 addition & 3 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

pnpm test
pnpm test
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
18.16.0
20.9.0
2 changes: 1 addition & 1 deletion .stylelintignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
index.ejs
index.ejs
2 changes: 1 addition & 1 deletion .stylelintrc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": ["stylelint-config-standard", "stylelint-config-prettier"],
"extends": ["stylelint-config-standard"],
"rules": {
"at-rule-no-unknown": [
true,
Expand Down
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,9 @@ The following technologies are used:
- **[Redux Toolkit](https://redux-toolkit.js.org)** (State management)
- **[PostCSS](https://postcss.org)** (CSS tooling)
- **[TailwindCSS](https://tailwindcss.com)** (Styling)
- **[Jest](https://jestjs.io)** (Unit Testing)
- **[Vitest](https://vitest.dev)** (Unit Testing)
- **[Testing Library](https://testing-library.com)** (Unit Testing)
- **[WebdriverIO](https://webdriver.io)** (End to End Testing)
- **[Prettier](https://prettier.io)** (Code formatting)
- **[ESLint](https://eslint.org)** (TS & JS linting)
- **[StyleLint](https://stylelint.io)** (CSS linting)


4 changes: 2 additions & 2 deletions docs/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ Static files such as images.

#### test/

Contains [Jest](https://jestjs.io/) unit / component integration tests and [WDIO](https://webdriver.io) end to end tests.
Contains [Vitest](https://vitest.dev/) unit / component integration tests and [WDIO](https://webdriver.io) end to end tests.

#### types/

Expand All @@ -70,4 +70,4 @@ The webpack build configuration, split across two files for each process and one

#### ...configuration files

The rest of the things in the root directory are configuration files for ESLint, Git, Prettier, StyleLint, Jest, PNPM, PostCSS, TailwindCSS, Electron Builder and TypeScript.
The rest of the things in the root directory are configuration files for ESLint, Git, Prettier, StyleLint, Vitest, PNPM, PostCSS, TailwindCSS, Electron Builder and TypeScript.
3 changes: 1 addition & 2 deletions electron-builder.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/* eslint-disable no-template-curly-in-string */
module.exports = {
export default {
asar: true,
appId: 'com.dj-helper.app',
copyright: `Copyright © ${new Date().getFullYear()} Goosewobbler`,
Expand Down
167 changes: 167 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
import eslint from '@eslint/js';
import ts from '@typescript-eslint/eslint-plugin';
import tsParser from '@typescript-eslint/parser';
import prettier from 'eslint-config-prettier';
import vitest from 'eslint-plugin-vitest';
import react from 'eslint-plugin-react';
import node from 'eslint-plugin-n';
import * as wdio from 'eslint-plugin-wdio';
import globals from 'globals';

export default [
// Ignored dirs
{
ignores: ['**/dist/**/*', '**/bundle/**/*', '**/static/**/*', '.vscode'],
},
// Ignored files
{
ignores: ['vitest.config.ts', 'eslint.config.js', 'test/features/lists/*.spec.tsx'],
},
// All files
{
files: ['**/*.{js,mjs,ts}'],
languageOptions: {
ecmaVersion: 'latest',
globals: {
...globals.es2021,
},
},
rules: {
...eslint.configs.recommended.rules,
},
},
// Node & Electron main process files and scripts
{
files: ['**/*.{js,mjs,ts,tsx}'],
ignores: ['src/renderer/*.{ts,tsx}'],
languageOptions: {
globals: {
...globals.node,
},
},
plugins: {
n: node,
},
rules: {
...node.configs['flat/recommended-script'].rules,
'n/no-unpublished-require': 'off',
'n/no-unpublished-import': 'off',
'n/no-missing-import': 'off',
},
},
// Electron renderer process files
{
files: ['src/renderer/*.{ts,tsx}'],
languageOptions: {
globals: {
...globals.browser,
},
},
},
// TS files
{
files: ['**/*.{ts,tsx}'],
languageOptions: {
parser: tsParser,
parserOptions: {
ecmaFeatures: { modules: true },
ecmaVersion: 'latest',
project: './tsconfig.json',
},
},
plugins: {
'@typescript-eslint': ts,
},
rules: {
...ts.configs['eslint-recommended'].rules,
...ts.configs.recommended.rules,
'no-undef': 'off', // redundant - TS will fail to compile with undefined vars
'no-redeclare': 'off', // redundant - TS will fail to compile with duplicate declarations
'@typescript-eslint/no-empty-interface': [
'error',
{
allowSingleExtends: true,
},
],
'@typescript-eslint/no-namespace': [
'error',
{
allowDeclarations: true,
},
],
'@typescript-eslint/no-unused-vars': [
'error',
{
args: 'after-used',
ignoreRestSiblings: true,
argsIgnorePattern: '^_',
destructuredArrayIgnorePattern: '^_',
},
],
'@typescript-eslint/no-explicit-any': ['warn'],
},
},
// TSX files
{
files: ['**/*.tsx'],
plugins: {
react,
},
languageOptions: {
parserOptions: {
ecmaFeatures: {
jsx: true,
},
},
},
},
// Script files
{
files: ['scripts/*.{mjs,js}'],
rules: {
'no-console': 'off',
},
},
// E2E files
{
files: ['test/e2e/*.spec.ts'],
languageOptions: {
globals: {
...wdio.configs.recommended.globals,
},
parser: tsParser,
parserOptions: {
ecmaFeatures: { modules: true },
ecmaVersion: 'latest',
project: './test/e2e/tsconfig.json',
},
},
plugins: {
wdio,
},
rules: {
...wdio.configs.recommended.rules,
'@typescript-eslint/no-var-requires': 'off',
},
},
// Unit Test files
{
files: ['test/features/**/*.spec.{ts,tsx}'],
languageOptions: {
parser: tsParser,
parserOptions: {
ecmaFeatures: { modules: true },
ecmaVersion: 'latest',
project: './test/tsconfig.json',
},
},
plugins: {
vitest,
},
rules: {
...vitest.configs.recommended.rules,
},
},
// ensure all rules work with prettier
prettier,
];
26 changes: 0 additions & 26 deletions jest.config.js

This file was deleted.

Loading