diff --git a/eslint-config/blui-rules.js b/eslint-config/blui-rules.js index 510aa1d..e35deb2 100644 --- a/eslint-config/blui-rules.js +++ b/eslint-config/blui-rules.js @@ -1,4 +1,4 @@ -export default { +module.exports = { '@typescript-eslint/array-type': ['error', { default: 'array-simple' }], '@typescript-eslint/consistent-type-definitions': ['error', 'type'], '@typescript-eslint/explicit-function-return-type': 'error', diff --git a/eslint-config/package.json b/eslint-config/package.json index 4271302..beddd1c 100644 --- a/eslint-config/package.json +++ b/eslint-config/package.json @@ -30,13 +30,15 @@ "prettier": "prettier \"**/**.{ts,tsx,js,jsx,json,css,scss,html,md}\" --write" }, "peerDependencies": { - "@typescript-eslint/eslint-plugin": "^8.10.0", - "eslint": ">= 9.12.0", "typescript": "5.5.4" }, "dependencies": { + "@eslint/js": "^9.13.0", + "typescript-eslint": "^8.11.0", + "eslint-plugin-prettier": "^5.2.1", + "eslint-config-prettier":"^9.1.0", "@typescript-eslint/parser": "^8.10.0", - "eslint-config-prettier": ">= 9.1.0" + "eslint": ">= 9.12.0" }, "optionalDependencies": { "eslint-plugin-react": "^7.37.1" @@ -51,8 +53,6 @@ "prettier": "@brightlayer-ui/prettier-config", "devDependencies": { "@brightlayer-ui/prettier-config": "^1.0.3", - "@typescript-eslint/eslint-plugin": "^8.10.0", - "eslint": ">= 9.12.0", "eslint-plugin-react": "^7.37.1", "prettier": "3.2.5", "typescript": "5.5.4" diff --git a/eslint-config/ts.js b/eslint-config/ts.js new file mode 100644 index 0000000..f38705a --- /dev/null +++ b/eslint-config/ts.js @@ -0,0 +1,21 @@ +const js = require('@eslint/js'); +const tseslint = require('typescript-eslint'); +const prettierRecommended = require('eslint-plugin-prettier/recommended'); +const typescriptEslintParser = require('@typescript-eslint/parser'); +const bluiRules = require('./blui-rules.js'); + +module.exports = [ + js.configs.recommended, + tseslint.configs.eslintRecommended, + ...tseslint.configs.recommendedTypeChecked, + ...tseslint.configs.stylisticTypeChecked, + prettierRecommended, + { + languageOptions: { + parser: typescriptEslintParser + }, + rules: { + ...bluiRules + }, + } +]; diff --git a/eslint-config/ts.mjs b/eslint-config/ts.mjs deleted file mode 100644 index 397129b..0000000 --- a/eslint-config/ts.mjs +++ /dev/null @@ -1,19 +0,0 @@ -import js from "@eslint/js"; -import tseslint from "typescript-eslint"; -import prettierRecommended from "eslint-plugin-prettier/recommended"; -import bluiRules from './blui-rules.js' - -export default [ - js.configs.recommended, - tseslint.configs.eslintRecommended, - ...tseslint.configs.recommendedTypeChecked, - ...tseslint.configs.stylisticTypeChecked, - prettierRecommended, - { - rules: { - 'react/prop-types': 'off', - 'react/display-name': 'off', - ...bluiRules - }, - } -]; diff --git a/eslint-config/tsx.mjs b/eslint-config/tsx.js similarity index 59% rename from eslint-config/tsx.mjs rename to eslint-config/tsx.js index 2eddd30..7a7a4c8 100644 --- a/eslint-config/tsx.mjs +++ b/eslint-config/tsx.js @@ -1,11 +1,11 @@ -import js from "@eslint/js"; -import reactRecommened from "eslint-plugin-react/configs/recommended.js" -import tseslint from "typescript-eslint"; -import prettierRecommended from "eslint-plugin-prettier/recommended"; -import typescriptEslintParser from "@typescript-eslint/parser"; -import bluiRules from './blui-rules.js' +const js = require('@eslint/js'); +const reactRecommened = require('eslint-plugin-react/configs/recommended.js'); +const tseslint = require('typescript-eslint'); +const prettierRecommended = require('eslint-plugin-prettier/recommended'); +const typescriptEslintParser = require('@typescript-eslint/parser'); +const bluiRules = require('./blui-rules.js'); -export default [ +module.exports = [ js.configs.recommended, tseslint.configs.eslintRecommended, ...tseslint.configs.recommendedTypeChecked,