diff --git a/templates/node-react-todo/.eslintrc.cjs b/templates/node-react-todo/.eslintrc.cjs deleted file mode 100644 index 8aef3e8..0000000 --- a/templates/node-react-todo/.eslintrc.cjs +++ /dev/null @@ -1,41 +0,0 @@ -/* -** -** Copyright (c) 2024, Oracle and/or its affiliates. -** All rights reserved -** Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ -*/ - -module.exports = { - root: true, - env: { - browser: true, - es2020: true, - worker: true, - node: true, - jest: true - }, - extends: [ - 'eslint:recommended' - ], - ignorePatterns: ['dist', '.eslintrc.cjs'], - parserOptions: { ecmaVersion: 'latest', sourceType: 'module' }, - overrides: [ - { - files: 'src/', - extends: [ - 'plugin:react/recommended', - 'plugin:react/jsx-runtime', - 'plugin:react-hooks/recommended', - ], - settings: { react: { version: 'detect' } }, - plugins: ['react-refresh'], - }, - { - files: 'server/', - extends: [ - 'plugin:node/recommended', - ], - - } - ] -} diff --git a/templates/node-react-todo/eslint.config.mjs b/templates/node-react-todo/eslint.config.mjs new file mode 100644 index 0000000..476ea0a --- /dev/null +++ b/templates/node-react-todo/eslint.config.mjs @@ -0,0 +1,62 @@ +/* +** +** Copyright (c) 2024, Oracle and/or its affiliates. +** All rights reserved +** Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ +*/ +import globals from "globals"; +import js from "@eslint/js"; +import nodePlugin from "eslint-plugin-n"; +import reactPlugin from "eslint-plugin-react"; +import reactHooksPlugin from "eslint-plugin-react-hooks"; +import reactRefreshPlugin from "eslint-plugin-react-refresh"; + +export default [ + { + files: ["src/**/*.js","src/**/*.jsx"], + languageOptions: { + ecmaVersion: 2022, + sourceType: "module", + parserOptions: { + ecmaFeatures: { + jsx: true + } + }, + globals: { + ...globals.browser, + } + }, + plugins: { + react: reactPlugin, + "react-hooks": reactHooksPlugin, + "react-refresh": reactRefreshPlugin + }, + settings: { + react: { version: 'detect' } + }, + rules: { + ...js.configs.recommended.rules, + ...reactPlugin.configs.flat.recommended.rules, + ...reactPlugin.configs.flat["jsx-runtime"].rules, + ...reactHooksPlugin.configs.recommended.rules, + ...reactRefreshPlugin.configs.vite.rules + } + }, + { + files: ["server/**/*.js", "server/**/*.cjs"], + languageOptions: { + ecmaVersion: 2022, + sourceType: "module", + globals: { + ...globals.node, + } + }, + plugins: { + n: nodePlugin + }, + rules: { + ...js.configs.recommended.rules, + ...nodePlugin.configs["flat/recommended-script"].rules + } + } +]; \ No newline at end of file diff --git a/templates/node-react-todo/package.json b/templates/node-react-todo/package.json index 2d19906..ec04f2a 100644 --- a/templates/node-react-todo/package.json +++ b/templates/node-react-todo/package.json @@ -5,30 +5,32 @@ "scripts": { "dev": "concurrently --names server,client --prefix-colors blue,yellow --success all --kill-others 'node ./server/index.cjs' 'vite'", "build": "vite build", - "lint": "eslint . --ext js,jsx --report-unused-disable-directives", + "lint": "eslint --report-unused-disable-directives", "preview": "vite preview" }, "dependencies": { - "body-parser": "^1.20.2", + "body-parser": "^1.20.3", "cors": "^2.8.5", - "dotenv": "^16.3.1", - "express": "^4.18.2", + "dotenv": "^16.4.7", + "express": "^4.21.2", "morgan": "^1.10.0", - "oracledb": "^6.2.0", - "react": "^18.2.0", - "react-dom": "^18.2.0", - "react-toastify": "^9.1.3" + "oracledb": "^6.7.1", + "react": "^19.0.0", + "react-dom": "^19.0.0", + "react-toastify": "^11.0.3" }, "devDependencies": { - "@types/react": "^18.2.43", - "@types/react-dom": "^18.2.17", - "@vitejs/plugin-react": "^4.2.1", - "concurrently": "^8.2.2", - "eslint": "^8.55.0", - "eslint-plugin-node": "^11.1.0", - "eslint-plugin-react": "^7.34.0", - "eslint-plugin-react-hooks": "^4.6.0", - "eslint-plugin-react-refresh": "^0.4.5", - "vite": "^5.0.8" + "@types/react": "^19.0.7", + "@types/react-dom": "^19.0.3", + "@vitejs/plugin-react": "^4.3.4", + "concurrently": "^9.1.2", + "eslint": "^9.18.0", + "@eslint/js": "^9.18.0", + "eslint-plugin-n": "^17.15.1", + "eslint-plugin-react": "^7.37.4", + "eslint-plugin-react-hooks": "^5.1.0", + "eslint-plugin-react-refresh": "^0.4.18", + "globals": "15.14.0", + "vite": "^6.0.7" } }