diff --git a/variants/frontend-react-typescript/template.rb b/variants/frontend-react-typescript/template.rb index 2f5cea00..1a891c81 100644 --- a/variants/frontend-react-typescript/template.rb +++ b/variants/frontend-react-typescript/template.rb @@ -1,15 +1,7 @@ source_paths.unshift(File.dirname(__FILE__)) -installed_jest_major_version = JSON.parse(File.read("node_modules/jest/package.json")).fetch("version").split(".").first - run "yarn remove prop-types" yarn_add_dependencies %w[@types/react @types/react-dom] -yarn_add_dev_dependencies [ - "@jest/types@#{installed_jest_major_version}", - "ts-jest@#{installed_jest_major_version}", - "ts-node" -] -run "yarn install" rename_js_file_to_ts "app/frontend/packs/server_rendering" @@ -49,5 +41,5 @@ TYPES end -remove_dir "app/frontend/test" -directory "app/frontend/test" +remove_dir "app/frontend/test/components" +directory "app/frontend/test/components" diff --git a/variants/frontend-react/.eslintrc.js b/variants/frontend-react/.eslintrc.js index 8f3661b2..c5eefd83 100644 --- a/variants/frontend-react/.eslintrc.js +++ b/variants/frontend-react/.eslintrc.js @@ -5,7 +5,7 @@ const config = { env: { commonjs: true, node: true, browser: true }, extends: ['ackama', 'ackama/react'], ignorePatterns: ['tmp/'], - parserOptions: { sourceType: 'module' }, + parserOptions: { sourceType: 'module', ecmaVersion: 2022 }, overrides: [ { files: [ diff --git a/variants/frontend-stimulus-typescript/template.rb b/variants/frontend-stimulus-typescript/template.rb index 1cdea584..55dbfc5a 100644 --- a/variants/frontend-stimulus-typescript/template.rb +++ b/variants/frontend-stimulus-typescript/template.rb @@ -14,7 +14,7 @@ remove_file "jest.config.js", force: true copy_file "jest.config.ts" -copy_file "babel.config.js" +copy_file "babel.config.js", force: true package_json = JSON.parse(File.read("./package.json"))