diff --git a/.eslintrc.json b/.eslintrc.json deleted file mode 100644 index ef9bcb1..0000000 --- a/.eslintrc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "eslint-config-ibexa/eslint" -} diff --git a/.github/workflows/frontend-ci.yaml b/.github/workflows/frontend-ci.yaml index 02e3d7b..ba29d83 100644 --- a/.github/workflows/frontend-ci.yaml +++ b/.github/workflows/frontend-ci.yaml @@ -3,13 +3,25 @@ name: Frontend build on: push: paths: + - "**.cjs" + - "**.mjs" - "**.js" + - "**.jsx" + - "**.ts" + - "**.tsx" + - "**.scss" branches: - main - '[0-9]+.[0-9]+' pull_request: paths: + - "**.cjs" + - "**.mjs" - "**.js" + - "**.jsx" + - "**.ts" + - "**.tsx" + - "**.scss" jobs: frontend-test: @@ -21,6 +33,6 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-node@v2 with: - node-version: '14' + node-version: '20' - run: yarn install - run: yarn test diff --git a/.gitignore b/.gitignore index 4ac5e75..591fb39 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ /vendor /yarn.lock /var +tsconfig.json diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 0000000..b14c02c --- /dev/null +++ b/eslint.config.mjs @@ -0,0 +1,5 @@ +import getIbexaConfig from '@ibexa/eslint-config/eslint'; + +export default [ + ...getIbexaConfig(), +]; diff --git a/ibexa.tsconfig.json b/ibexa.tsconfig.json new file mode 100644 index 0000000..ad45c07 --- /dev/null +++ b/ibexa.tsconfig.json @@ -0,0 +1,7 @@ +{ + "extends": "@ibexa/ts-config", + "include": [ + "src/bundle/**/*.ts", + "src/bundle/**/*.tsx" + ] +} diff --git a/package.json b/package.json index 9b009c3..1fbe50f 100644 --- a/package.json +++ b/package.json @@ -2,15 +2,20 @@ "name": "twig-components", "repository": "git@github.com:ibexa/twig-components.git", "private": true, - "prettier": "eslint-config-ibexa/prettier", + "prettier": "@ibexa/eslint-config/prettier", "dependencies": {}, "devDependencies": { - "eslint-config-ibexa": "https://github.com/ibexa/eslint-config-ibexa.git#v1.0.0" + "@ibexa/eslint-config": "https://github.com/ibexa/eslint-config-ibexa.git#~v2.0.0", + "@ibexa/ts-config": "https://github.com/ibexa/ts-config-ibexa#~v1.1.0", + "@types/react": "^19.1.2", + "@types/react-dom": "^19.1.2" }, "scripts": { "test": "yarn prettier-test && yarn eslint-test", "fix": "yarn prettier-test --write && yarn eslint-test --fix", - "eslint-test": "eslint \"./src/bundle/Resources/**/*.js\" \"./src/bundle/ui-dev/**/*.js\"", - "prettier-test": "yarn prettier \"./src/bundle/Resources/**/*.{js,scss}\" \"./src/bundle/ui-dev/**/*.js\" --check" + "ts-test": "tsc --noEmit", + "eslint-test": "eslint \"./src/bundle/Resources/**/*.{js,ts}\"", + "prettier-test": "yarn prettier \"./src/bundle/Resources/**/*.{js,ts,scss}\" --check", + "postinstall": "yarn ibexa-generate-tsconfig --use-root-project-tsconfig" } }