Skip to content

Commit

Permalink
chore: update dependencies and configuration
Browse files Browse the repository at this point in the history
- Updated pillarbox to 1.15.1 on the editor page
- Updated ESLint from v8 to v9 and migrated configuration file to new format
- Updated development dependencies: Babel, Vitest, Husky, Stylelint, Sass...
- Removed unused modules like Parcel
  • Loading branch information
jboix committed Nov 4, 2024
1 parent 6573dfa commit 5608381
Show file tree
Hide file tree
Showing 13 changed files with 3,129 additions and 3,552 deletions.
113 changes: 0 additions & 113 deletions .eslintrc.json

This file was deleted.

3 changes: 0 additions & 3 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx --no -- commitlint --edit ${1}
3 changes: 0 additions & 3 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npm run eslint && npm run stylelint
3 changes: 0 additions & 3 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npm test
98 changes: 98 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
import globals from 'globals';
import vitest from '@vitest/eslint-plugin';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import js from '@eslint/js';
import { FlatCompat } from '@eslint/eslintrc';

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 [...compat.extends('eslint:recommended'), {
languageOptions: {
globals: {
...globals.browser,
},

ecmaVersion: 'latest',
sourceType: 'module',
},

rules: {
complexity: ['error', {
max: 5,
}],

'function-paren-newline': ['error', 'multiline-arguments'],
'linebreak-style': ['error', 'unix'],
'max-depth': ['error', 2],

'max-len': ['error', {
code: 80,
ignoreComments: true,
ignoreStrings: true,
ignoreTemplateLiterals: true,
ignoreTrailingComments: true,
ignoreUrls: true,
}],

'max-lines-per-function': ['error', {
max: 35,
skipComments: true,
}],

'max-nested-callbacks': ['error', 3],
'max-statements': ['error', 10],
'newline-after-var': ['error', 'always'],

'no-bitwise': ['error', {
int32Hint: true,
}],

'no-cond-assign': ['error', 'always'],

'no-console': ['error', {
allow: ['warn', 'error'],
}],

'no-plusplus': ['error', {
allowForLoopAfterthoughts: true,
}],

'padding-line-between-statements': ['error', {
blankLine: 'always',
prev: '*',
next: 'return',
}],

semi: ['error', 'always'],
'space-before-function-paren': ['error', 'never'],
},
}, {
files: ['test/**'],

plugins: {
vitest,
},

languageOptions: {
globals: {
global: true
}
},

rules: {
...vitest.configs.recommended.rules,
complexity: 'off',
'max-lines-per-function': 'off',
'max-statements': 'off',
'max-nested-callbacks': 'off',
'max-len': 'off',
'no-conditional-expect': 'off',
},
}];
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ <h2>Live Canvas Preview</h2>
<datalist id="default-options">
<option value="urn:srf:video:c4927fcf-e1a0-0001-7edd-1ef01d441651">Live video</option>
<option value="urn:rts:video:3608506">Live video (DVR)</option>
<option value="urn:swi:video:49122298">Video</option>
<option value="urn:srf:video:05457f66-fd67-4131-8e0a-6d85743efc39">Video</option>
<option value="urn:rsi:audio:2108350">Audio</option>
<option value="urn:rtr:audio:a029e818-77a5-4c2e-ad70-d573bb865e31">Live audio (DVR)</option>
</datalist>
Expand Down
Loading

0 comments on commit 5608381

Please sign in to comment.