feature: migration TS + eslint 10
This commit is contained in:
+6
-4
@@ -3,7 +3,7 @@ import unicorn from 'eslint-plugin-unicorn';
|
|||||||
import promise from 'eslint-plugin-promise';
|
import promise from 'eslint-plugin-promise';
|
||||||
import n from 'eslint-plugin-n';
|
import n from 'eslint-plugin-n';
|
||||||
import raflint from 'eslint-plugin-raflint';
|
import raflint from 'eslint-plugin-raflint';
|
||||||
import pluginimport from 'eslint-plugin-import';
|
import pluginimport from 'eslint-plugin-import-x';
|
||||||
import babelParser from '@babel/eslint-parser';
|
import babelParser from '@babel/eslint-parser';
|
||||||
import js from '@eslint/js';
|
import js from '@eslint/js';
|
||||||
import globals from 'globals';
|
import globals from 'globals';
|
||||||
@@ -24,7 +24,7 @@ export default [
|
|||||||
// promise
|
// promise
|
||||||
promise.configs['flat/recommended'],
|
promise.configs['flat/recommended'],
|
||||||
|
|
||||||
// plugin:import/recommended,
|
// plugin:import-x/recommended,
|
||||||
pluginimport.flatConfigs.recommended,
|
pluginimport.flatConfigs.recommended,
|
||||||
|
|
||||||
{
|
{
|
||||||
@@ -56,8 +56,8 @@ export default [
|
|||||||
'sonarjs/publicly-writable-directories': 0,
|
'sonarjs/publicly-writable-directories': 0,
|
||||||
'sonarjs/file-permissions': 0,
|
'sonarjs/file-permissions': 0,
|
||||||
'sonarjs/no-empty-test-file': 0,
|
'sonarjs/no-empty-test-file': 0,
|
||||||
'import/no-named-as-default-member': 0,
|
'import-x/no-named-as-default-member': 0,
|
||||||
'import/no-unresolved': [
|
'import-x/no-unresolved': [
|
||||||
'error',
|
'error',
|
||||||
{
|
{
|
||||||
ignore: [
|
ignore: [
|
||||||
@@ -137,6 +137,8 @@ export default [
|
|||||||
// ne pas retirer `undefined` passe en argument (souvent requis par la signature -> casse tsc)
|
// ne pas retirer `undefined` passe en argument (souvent requis par la signature -> casse tsc)
|
||||||
'unicorn/no-useless-undefined': ['error', { checkArguments: false }],
|
'unicorn/no-useless-undefined': ['error', { checkArguments: false }],
|
||||||
'unicorn/relative-url-style': 0,
|
'unicorn/relative-url-style': 0,
|
||||||
|
// autofix http->https qui corrompt les URLs de fixtures/data
|
||||||
|
'unicorn/prefer-https': 0,
|
||||||
'unicorn/switch-case-braces': 0,
|
'unicorn/switch-case-braces': 0,
|
||||||
'unicorn/template-indent': 0,
|
'unicorn/template-indent': 0,
|
||||||
'unicorn/text-encoding-identifier-case': 0,
|
'unicorn/text-encoding-identifier-case': 0,
|
||||||
|
|||||||
Generated
+831
-2725
File diff suppressed because it is too large
Load Diff
+8
-8
@@ -17,22 +17,22 @@
|
|||||||
"start": "node server.js"
|
"start": "node server.js"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"csv-parse": "^6.2.1",
|
"csv-parse": "^7.0.0",
|
||||||
"dotenv": "^17.4.2",
|
"dotenv": "^17.4.2",
|
||||||
"find-up": "^8.0.0",
|
"find-up": "^8.0.0",
|
||||||
"mysql2": "^3.22.5"
|
"mysql2": "^3.22.5"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/core": "^7.29.7",
|
"@babel/core": "^8.0.1",
|
||||||
"@babel/eslint-parser": "^7.29.7",
|
"@babel/eslint-parser": "^8.0.1",
|
||||||
"@eslint/js": "^9.39.4",
|
"@eslint/js": "^10.0.1",
|
||||||
"eslint": "^9.39.4",
|
"eslint": "^10.5.0",
|
||||||
"eslint-plugin-import": "^2.32.0",
|
"eslint-plugin-import-x": "^4.16.2",
|
||||||
"eslint-plugin-n": "^18.1.0",
|
"eslint-plugin-n": "^18.1.0",
|
||||||
"eslint-plugin-promise": "^7.3.0",
|
"eslint-plugin-promise": "^7.3.0",
|
||||||
"eslint-plugin-raflint": "^1.4.0",
|
"eslint-plugin-raflint": "^1.4.1",
|
||||||
"eslint-plugin-sonarjs": "^4.0.3",
|
"eslint-plugin-sonarjs": "^4.0.3",
|
||||||
"eslint-plugin-unicorn": "^65.0.1",
|
"eslint-plugin-unicorn": "^67.0.0",
|
||||||
"globals": "^17.6.0",
|
"globals": "^17.6.0",
|
||||||
"husky": "^9.1.7",
|
"husky": "^9.1.7",
|
||||||
"lint-staged": "^17.0.7",
|
"lint-staged": "^17.0.7",
|
||||||
|
|||||||
@@ -28,10 +28,7 @@ const dbConfig = {
|
|||||||
async function getYearsOnServer() {
|
async function getYearsOnServer() {
|
||||||
const res = await fetch(`${BASE_URL}/`);
|
const res = await fetch(`${BASE_URL}/`);
|
||||||
const html = await res.text();
|
const html = await res.text();
|
||||||
const years = [];
|
const years = Array.from(html.matchAll(/href="(\d{4})\/"/g), match => Number(match[1]));
|
||||||
for (const match of html.matchAll(/href="(\d{4})\/"/g)) {
|
|
||||||
years.push(Number(match[1]));
|
|
||||||
}
|
|
||||||
return years.toSorted();
|
return years.toSorted();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user