Просмотр исходного кода

chore: upgrades "eslint" and "typescript"

e22m4u 1 год назад
Родитель
Сommit
cbfd46d562
4 измененных файлов с 29 добавлено и 22 удалено
  1. 0 1
      .eslintignore
  2. 0 19
      .eslintrc.cjs
  3. 25 0
      eslint.config.js
  4. 4 2
      package.json

+ 0 - 1
.eslintignore

@@ -1 +0,0 @@
-*.d.ts

+ 0 - 19
.eslintrc.cjs

@@ -1,19 +0,0 @@
-module.exports = {
-  env: {
-    es2021: true
-  },
-  parserOptions: {
-    sourceType: 'module',
-    ecmaVersion: 13,
-  },
-  plugins: [
-    'mocha',
-    'chai-expect',
-  ],
-  extends: [
-    'eslint:recommended',
-    'prettier',
-    'plugin:mocha/recommended',
-    'plugin:chai-expect/recommended',
-  ],
-}

+ 25 - 0
eslint.config.js

@@ -0,0 +1,25 @@
+import js from '@eslint/js';
+import globals from 'globals';
+import mochaPlugin from 'eslint-plugin-mocha';
+import chaiExpectPlugin from 'eslint-plugin-chai-expect';
+import eslintConfigPrettier from 'eslint-config-prettier';
+
+export default [{
+  languageOptions: {
+    globals: {
+      ...globals.es2021,
+      ...globals.mocha,
+    },
+  },
+  plugins: {
+    'mocha': mochaPlugin,
+    'chai-expect': chaiExpectPlugin,
+  },
+  rules: {
+    ...js.configs.recommended.rules,
+    ...eslintConfigPrettier.rules,
+    ...mochaPlugin.configs.flat.recommended.rules,
+    ...chaiExpectPlugin.configs['recommended-flat'].rules,
+  },
+  files: ['src/**/*.js'],
+}];

+ 4 - 2
package.json

@@ -31,15 +31,17 @@
   "devDependencies": {
     "@commitlint/cli": "~19.3.0",
     "@commitlint/config-conventional": "~19.2.2",
+    "@eslint/js": "^9.5.0",
     "c8": "~10.1.2",
     "chai": "~5.1.1",
-    "eslint": "~8.57.0",
+    "eslint": "~9.5.0",
     "eslint-config-prettier": "~9.1.0",
     "eslint-plugin-chai-expect": "~3.1.0",
     "eslint-plugin-mocha": "~10.4.3",
+    "globals": "^15.6.0",
     "husky": "~9.0.11",
     "mocha": "~10.4.0",
     "prettier": "~3.3.2",
-    "typescript": "~5.4.5"
+    "typescript": "~5.5.2"
   }
 }