From acf7a79d0e6d3d09f4fc029d3eb35dd905d2b3ea Mon Sep 17 00:00:00 2001 From: TheMas3212 Date: Sun, 2 Feb 2025 17:32:57 +1100 Subject: Update eslint and eslint ruleset --- .eslintrc.json | 13 ------------- eslint.config.js | 30 ++++++++++++++++++++++++++++++ package.json | 6 ++++-- 3 files changed, 34 insertions(+), 15 deletions(-) delete mode 100644 .eslintrc.json create mode 100644 eslint.config.js diff --git a/.eslintrc.json b/.eslintrc.json deleted file mode 100644 index b4f98f4..0000000 --- a/.eslintrc.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "parser": "@typescript-eslint/parser", - "rules": { - "semi": ["error", "always"] - }, - "parserOptions": { - "ecmaVersion": 9, - "sourceType": "module", - "ecmaFeatures": { - "modules": true - } - } -} diff --git a/eslint.config.js b/eslint.config.js new file mode 100644 index 0000000..6915679 --- /dev/null +++ b/eslint.config.js @@ -0,0 +1,30 @@ +const stylisticTs = require('@stylistic/eslint-plugin-ts'); +const parserTs = require('@typescript-eslint/parser'); +const typescriptPlugin = require('@typescript-eslint/eslint-plugin'); + +module.exports = [ + { + plugins: { + '@stylistic/ts': stylisticTs, + '@typescript-eslint': typescriptPlugin + }, + languageOptions: { + parser: parserTs, + parserOptions: { + ecmaVersion: 13, + sourceType: "module", + ecmaFeatures: { + modules: true + } + } + }, + rules: { + '@stylistic/ts/indent': ['error', 2], + "@stylistic/ts/quotes": ["error", "double"], + "@stylistic/ts/semi": ["error", "always"] + }, + files: [ + "src/**/*.ts" + ], + } +] diff --git a/package.json b/package.json index 7797691..a443324 100644 --- a/package.json +++ b/package.json @@ -23,8 +23,10 @@ "url": "https://github.com/TheMas3212/tasd-js.git" }, "devDependencies": { - "@typescript-eslint/parser": "^5.31.0", - "eslint": "^8.20.0", + "@stylistic/eslint-plugin-ts": "^1.6.3", + "@typescript-eslint/eslint-plugin": "^7.1.1", + "@typescript-eslint/parser": "^7.1.1", + "eslint": "^8.53.0", "ts-loader": "^9.4.4", "typescript": "^4.7.4", "webpack": "^5.88.2", -- cgit v1.2.3