Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
version: 9
- uses: actions/setup-node@v4
with:
node-version: 20
node-version: 22
registry-url: https://registry.npmjs.org
cache: pnpm
- name: Install Dependencies
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
version: 9
- uses: actions/setup-node@v4
with:
node-version: 20
node-version: 22
cache: pnpm
- name: Install & Build
run: |
Expand Down
69 changes: 0 additions & 69 deletions eslint.config.mjs

This file was deleted.

118 changes: 118 additions & 0 deletions eslint.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
import cspellPlugin from '@cspell/eslint-plugin';
import eslint from '@eslint/js';
import stylistic from '@stylistic/eslint-plugin';
import eslintConfigPrettier from 'eslint-config-prettier';
import react from 'eslint-plugin-react';
import simpleImportSortPlugin from 'eslint-plugin-simple-import-sort';
import globals from 'globals';
import tsEslint, { ConfigArray } from 'typescript-eslint';
import { fileURLToPath } from 'url';

/**
* @see{@link https://github.com/typescript-eslint/typescript-eslint/blob/main/eslint.config.mjs}
*/

const tsconfigRootDir = fileURLToPath(new URL('.', import.meta.url));

const config: ConfigArray = tsEslint.config(
// register all of the plugins up-front
{
plugins: {
'@typescript-eslint': tsEslint.plugin,
react,
'@stylistic': stylistic,
'simple-import-sort': simpleImportSortPlugin,
'@cspell': cspellPlugin
}
},
{
// config with just ignores is the replacement for `.eslintignore`
ignores: ['**/node_modules/**', '**/public/**', '**/.next/**']
},

// extends ...
eslint.configs.recommended,
...tsEslint.configs.recommended,

// base config
{
languageOptions: {
globals: { ...globals.es2020, ...globals.browser, ...globals.node },
parserOptions: {
projectService: true,
tsconfigRootDir,
warnOnUnsupportedTypeScriptVersion: false
}
},
rules: {
'arrow-body-style': ['error', 'as-needed'],
'no-empty-pattern': 'warn',
'no-console': ['error', { allow: ['warn', 'error', 'info'] }],
'consistent-return': 'warn',
'prefer-destructuring': ['error', { object: true, array: true }],

// react
'react/no-unescaped-entities': 'off',
'react/self-closing-comp': [
'error',
{ component: true, html: true }
],
'react/jsx-curly-brace-presence': [
'error',
{ props: 'never', children: 'never' }
],
'react/jsx-no-target-blank': 'warn',
'react/jsx-sort-props': [
'error',
{
reservedFirst: true,
callbacksLast: true,
noSortAlphabetically: true
}
],
// typescript
'@typescript-eslint/no-unused-vars': 'warn',
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/no-empty-object-type': 'off',
'@typescript-eslint/no-unsafe-declaration-merging': 'warn',

// stylistic
'@stylistic/padding-line-between-statements': [
'error',
{ blankLine: 'always', prev: '*', next: 'return' },
{ blankLine: 'always', prev: 'directive', next: '*' },
{ blankLine: 'any', prev: 'directive', next: 'directive' },
{
blankLine: 'always',
prev: '*',
next: ['enum', 'interface', 'type']
}
],

// simple-import-sort
'simple-import-sort/exports': 'error',
'simple-import-sort/imports': 'error',
// spellchecker
'@cspell/spellchecker': [
'warn',
{
cspell: {
language: 'en',
dictionaries: [
'typescript',
'node',
'html',
'css',
'bash',
'npm',
'pnpm'
]
}
}
]
}
},
eslintConfigPrettier
);

export default config;
54 changes: 28 additions & 26 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,50 +27,52 @@
"types": "dist/index.d.ts",
"dependencies": {
"@swc/helpers": "^0.5.15",
"dom-renderer": "^2.6.0",
"mobx": ">=6.11",
"dom-renderer": "^2.6.2",
"mobx": ">=6.13.6",
"regenerator-runtime": "^0.14.1",
"web-utility": "^4.4.2"
"web-utility": "^4.4.3"
},
"peerDependencies": {
"@webcomponents/webcomponentsjs": "^2.8",
"core-js": "^3",
"jsdom": ">=23.1"
},
"devDependencies": {
"@eslint/compat": "^1.2.3",
"@eslint/js": "^9.15.0",
"@parcel/config-default": "~2.13.0",
"@parcel/packager-ts": "~2.13.0",
"@parcel/transformer-typescript-tsc": "~2.13.0",
"@parcel/transformer-typescript-types": "~2.13.0",
"@cspell/eslint-plugin": "^8.17.5",
"@eslint/js": "^9.22.0",
"@parcel/config-default": "~2.13.3",
"@parcel/packager-ts": "~2.13.3",
"@parcel/transformer-typescript-tsc": "~2.13.3",
"@parcel/transformer-typescript-types": "~2.13.3",
"@stylistic/eslint-plugin": "^4.2.0",
"@types/eslint-config-prettier": "^6.11.3",
"@types/jest": "^29.5.14",
"@types/node": "^20.17.6",
"core-js": "^3.39.0",
"element-internals-polyfill": "^1.3.12",
"eslint": "^9.15.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-react": "^7.37.2",
"@types/node": "^22.13.10",
"core-js": "^3.41.0",
"element-internals-polyfill": "^1.3.13",
"eslint": "^9.22.0",
"eslint-config-prettier": "^10.1.1",
"eslint-plugin-react": "^7.37.4",
"eslint-plugin-simple-import-sort": "^12.1.1",
"globals": "^15.12.0",
"globals": "^16.0.0",
"husky": "^9.1.7",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"jsdom": "^25.0.1",
"lint-staged": "^15.2.10",
"jiti": "^2.4.2",
"jsdom": "^26.0.0",
"lint-staged": "^15.5.0",
"open-cli": "^8.0.0",
"parcel": "~2.13.0",
"prettier": "^3.3.3",
"prettier-plugin-sh": "^0.14.0",
"parcel": "~2.13.3",
"prettier": "^3.5.3",
"prettier-plugin-sh": "^0.15.0",
"replace": "^1.2.2",
"rimraf": "^6.0.1",
"ts-jest": "^29.2.5",
"ts-jest": "^29.2.6",
"ts-node": "^10.9.2",
"typedoc": "^0.26.11",
"typedoc-plugin-mdn-links": "^3.3.8",
"typescript": "~5.6.3",
"typescript-eslint": "^8.15.0"
"typedoc": "^0.27.9",
"typedoc-plugin-mdn-links": "^5.0.1",
"typescript": "~5.8.2",
"typescript-eslint": "^8.26.1"
},
"scripts": {
"prepare": "husky",
Expand Down
Loading
Loading