chore: migrate linting to flat config and standardize toolchain requirements

This commit is contained in:
hazre committed 2026-02-14 18:32:45 +01:00
1 parent 3df0ae96e2
commit f0a13baff9
8 files changed
+1042 -731

No files matched your search

-2
View File
@@ -1,2 +0,0 @@
experiment
node_modules
-67
View File
@@ -1,67 +0,0 @@
module.exports = {
ignorePatterns: ['**/*.css'],
env: {
browser: true,
es2021: true,
},
extends: [
'eslint:recommended',
'plugin:react/recommended',
'plugin:react-hooks/recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'airbnb',
'prettier',
],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 'latest',
sourceType: 'module',
},
globals: {
JSX: 'readonly',
},
plugins: ['react', '@typescript-eslint'],
rules: {
'linebreak-style': 0,
'no-underscore-dangle': 0,
'no-shadow': 'off',
'import/prefer-default-export': 'off',
'import/extensions': 'off',
'import/no-unresolved': 'off',
'import/no-extraneous-dependencies': [
'error',
{
devDependencies: true,
},
],
'react/no-unstable-nested-components': ['error', { allowAsProps: true }],
'react/jsx-filename-extension': [
'error',
{
extensions: ['.tsx', '.jsx'],
},
],
'react/require-default-props': 'off',
'react/jsx-props-no-spreading': 'off',
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'error',
'@typescript-eslint/no-unused-vars': 'error',
'@typescript-eslint/no-shadow': 'error',
},
overrides: [
{
files: ['*.ts'],
rules: {
'no-undef': 'off',
},
},
],
};
+1
View File
@@ -0,0 +1 @@
v24.4.1
+2 -1
View File
@@ -1,2 +1,3 @@
legacy-peer-deps=true
save-exact=true
save-exact=true
engine-strict=true
+90
View File
@@ -0,0 +1,90 @@
import { fileURLToPath } from 'node:url';
import path from 'node:path';
import js from '@eslint/js';
import { FlatCompat } from '@eslint/eslintrc';
import css from '@eslint/css';
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all,
});
export default [
{
files: ['**/*.css'],
plugins: { css },
language: 'css/css',
rules: css.configs.recommended.rules,
},
...compat
.config({
env: {
browser: true,
es2021: true,
},
extends: [
'eslint:recommended',
'plugin:react/recommended',
'plugin:react-hooks/recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'airbnb',
'prettier',
],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 'latest',
sourceType: 'module',
},
globals: {
JSX: 'readonly',
},
plugins: ['react', '@typescript-eslint'],
rules: {
'linebreak-style': 0,
'no-unused-vars': 'off',
'no-underscore-dangle': 0,
'no-shadow': 'off',
'import/prefer-default-export': 'off',
'import/extensions': 'off',
'import/no-unresolved': 'off',
'import/no-extraneous-dependencies': [
'error',
{
devDependencies: true,
},
],
'react/no-unstable-nested-components': ['error', { allowAsProps: true }],
'react/jsx-filename-extension': [
'error',
{
extensions: ['.tsx', '.jsx'],
},
],
'react/require-default-props': 'off',
'react/jsx-props-no-spreading': 'off',
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'error',
'@typescript-eslint/no-unused-vars': 'error',
'@typescript-eslint/no-shadow': 'error',
},
overrides: [
{
files: ['*.ts'],
rules: {
'no-undef': 'off',
},
},
],
})
.map((config) =>
config.files ? config : { ...config, files: ['**/*.{js,jsx,ts,tsx,mjs,cjs}'] }
),
];
+933 -652
View File
File diff suppressed because it is too large. Load diff
+14 -9
View File
@@ -4,8 +4,10 @@
"description": "Yet another matrix client",
"main": "index.js",
"type": "module",
"packageManager": "[email protected]+sha512.8bc844e37892200305b98562f13c6c10849d10b3387c8cdaeb4d1a2e32746a79063cba9dd284cf28c26a01c3bf4169b7d3b31b4a5586cc970d6749463108073c",
"engines": {
"node": ">=16.0.0"
"node": "24.x",
"npm": "11.x"
},
"scripts": {
"start": "vite",
@@ -77,6 +79,9 @@
},
"devDependencies": {
"@esbuild-plugins/node-globals-polyfill": "0.2.3",
"@eslint/css": "0.14.1",
"@eslint/eslintrc": "3.3.3",
"@eslint/js": "10.0.1",
"@rollup/plugin-inject": "5.0.3",
"@rollup/plugin-wasm": "6.1.1",
"@types/chroma-js": "3.1.1",
@@ -89,17 +94,17 @@
"@types/react-google-recaptcha": "2.1.8",
"@types/sanitize-html": "2.9.0",
"@types/ua-parser-js": "0.7.36",
"@typescript-eslint/eslint-plugin": "5.46.1",
"@typescript-eslint/parser": "5.46.1",
"@typescript-eslint/eslint-plugin": "8.55.0",
"@typescript-eslint/parser": "8.55.0",
"@vitejs/plugin-react": "4.2.0",
"buffer": "6.0.3",
"eslint": "8.29.0",
"eslint": "9.39.2",
"eslint-config-airbnb": "19.0.4",
"eslint-config-prettier": "8.5.0",
"eslint-plugin-import": "2.29.1",
"eslint-plugin-jsx-a11y": "6.6.1",
"eslint-plugin-react": "7.31.11",
"eslint-plugin-react-hooks": "4.6.0",
"eslint-config-prettier": "10.1.8",
"eslint-plugin-import": "2.32.0",
"eslint-plugin-jsx-a11y": "6.10.2",
"eslint-plugin-react": "7.37.5",
"eslint-plugin-react-hooks": "7.0.1",
"prettier": "2.8.1",
"typescript": "5.9.3",
"vite": "5.4.19",
+2
View File
@@ -94,6 +94,7 @@ textarea {
padding: 0;
background-color: transparent;
color: inherit;
/* eslint-disable-next-line css/font-family-fallbacks */
font-family: inherit;
font-size: inherit;
font-weight: inherit;
@@ -127,5 +128,6 @@ textarea {
}
audio:not([controls]) {
/* eslint-disable-next-line css/no-important */
display: none !important;
}