Skip to content

FIO-7733: type the form component #558

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 23 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 29 additions & 4 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,41 @@
"es2021": true,
"node": true
},
"extends": ["eslint:recommended", "plugin:react/recommended", "prettier"],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:react/recommended",
"plugin:react-hooks/recommended",
"prettier"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": ["react"],
"rules": {},
"plugins": ["@typescript-eslint", "react"],
"rules": {
"react/prop-types": "warn",
"@typescript-eslint/no-explicit-any": "warn",
"react/react-in-jsx-scope": "off",
"react/jsx-uses-react": "off",
"@typescript-eslint/no-unused-vars": [
"error",
{ "ignoreRestSiblings": true }
]
},
"settings": {
"react": {
"version": "detect"
}
}
},
"ignorePatterns": ["node_modules/", "dist/", "lib/"],
"overrides": [
{
"files": ["**/*.test.ts", "**/*.test.tsx"],
"env": {
"jest": true
}
}
]
}
18 changes: 10 additions & 8 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:

1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
Expand All @@ -24,15 +24,17 @@ A clear and concise description of what you expected to happen.
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
1 change: 0 additions & 1 deletion .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
Expand Down
24 changes: 12 additions & 12 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,30 @@ https://formio.atlassian.net/browse/FIO-XXXX

**What changed?**

*Use this section to provide a summary description of the changes you've made*
_Use this section to provide a summary description of the changes you've made_

**Why have you chosen this solution?**

*Use this section to justify your choices*
_Use this section to justify your choices_

## Breaking Changes / Backwards Compatibility

*Use this section to describe any potentially breaking changes this PR introduces or any effects this PR might have on backwards compatibility*
_Use this section to describe any potentially breaking changes this PR introduces or any effects this PR might have on backwards compatibility_

## Dependencies

*Use this section to list any dependent changes/PRs in other Form.io modules*
_Use this section to list any dependent changes/PRs in other Form.io modules_

## How has this PR been tested?

*Use this section to describe how you tested your changes; if you haven't included automated tests, justify your reasoning*
_Use this section to describe how you tested your changes; if you haven't included automated tests, justify your reasoning_

## Checklist:

- [ ] I have completed the above PR template
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation (if applicable)
- [ ] My changes generate no new warnings
- [ ] My changes include tests that prove my fix is effective (or that my feature works as intended)
- [ ] New and existing unit/integration tests pass locally with my changes
- [ ] Any dependent changes have corresponding PRs that are listed above
- [ ] I have completed the above PR template
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation (if applicable)
- [ ] My changes generate no new warnings
- [ ] My changes include tests that prove my fix is effective (or that my feature works as intended)
- [ ] New and existing unit/integration tests pass locally with my changes
- [ ] Any dependent changes have corresponding PRs that are listed above
206 changes: 169 additions & 37 deletions README.md

Large diffs are not rendered by default.

13 changes: 0 additions & 13 deletions babel.config.json

This file was deleted.

17 changes: 17 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/** @type {import('ts-jest').JestConfigWithTsJest} */
module.exports = {
preset: 'ts-jest',
testEnvironment: 'jsdom',
testPathIgnorePatterns: [
'/node_modules/',
'/lib/',
'/dist/',
'/test/',
'/.+\\.d\\.ts$',
],
transform: {
'^.+\\.css$': 'jest-transform-css',
},
transformIgnorePatterns: [],
verbose: true,
};
62 changes: 0 additions & 62 deletions karma.conf.js

This file was deleted.

53 changes: 24 additions & 29 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
{
"name": "@formio/react",
"version": "5.3.0",
"version": "5.3.1-dev.AvA08V.6",
"description": "React renderer for form.io forms.",
"main": "lib/index.js",
"scripts": {
"test": "karma start --single-run",
"build": "babel ./src --ignore=*.spec.js --out-dir ./lib",
"build-types": "npx tsc",
"test": "jest",
"build": "tsc --project tsconfig.json",
"lint": "eslint src",
"format": "prettier . --write",
"watch": "babel ./src --watch --ignore=*.spec.js --out-dir ./lib --presets es2015,react,stage-2",
"prepublish": "yarn format && yarn lint && yarn build && yarn build-types"
"prepublish": "yarn format && yarn lint && yarn build"
},
"repository": {
"type": "git",
Expand All @@ -30,48 +28,45 @@
},
"homepage": "https://github.com/formio/react-formio#readme",
"dependencies": {
"babel-polyfill": "^6.26.0",
"core-js": "^3.35.1",
"eventemitter2": "^6.4.5",
"lodash": "^4.17.21",
"prop-types": "^15.8.1"
},
"devDependencies": {
"@babel/cli": "^7.23.4",
"@babel/core": "^7.23.7",
"@babel/preset-env": "^7.23.8",
"@babel/preset-react": "^7.23.3",
"@formio/js": "^5.0.0-rc.33",
"babel-loader": "^9.1.3",
"chai": "^4.3.6",
"enzyme": "^3.11.0",
"enzyme-adapter-react-16": "^1.15.6",
"escope": "^4.0.0",
"@formio/core": "^1.2.0",
"@formio/js": "5.0.0-bb.dev.6",
"@testing-library/jest-dom": "^6.4.2",
"@testing-library/react": "^14.2.2",
"@types/jest": "^29.5.12",
"@types/lodash": "^4.14.202",
"@types/react": "^18.2.55",
"@typescript-eslint/eslint-plugin": "^7.0.1",
"@typescript-eslint/parser": "^7.0.1",
"bootstrap": "^5.3.3",
"eslint": "^8.56.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-mocha": "^10.2.0",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "^4.6.0",
"identity-obj-proxy": "^3.0.0",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"jest-transform-css": "^6.0.1",
"jsdom": "^22.1.0",
"karma": "^6.3.18",
"karma-chrome-launcher": "^3.1.1",
"karma-mocha": "^2.0.1",
"karma-mocha-reporter": "^2.2.5",
"karma-webpack": "^5.0.0",
"mocha": "^10.2.0",
"prettier": "3.2.4",
"react": "^18.1.0",
"react-dom": "^18.1.0",
"react-test-renderer": "^18.2.0",
"react-transform-catch-errors": "^1.0.0",
"sinon": "^15.2.0",
"typescript": "^5.1.6",
"ts-jest": "^29.1.2",
"ts-node": "^10.9.2",
"tsc": "^2.0.4",
"typescript": "^5.3.3",
"webpack": "^5.88.2"
},
"files": [
"lib"
],
"peerDependencies": {
"@formio/js": "^5.0.0-rc.33",
"@formio/js": "5.0.0-bb.dev.3",
"react": "^15.3.0 || ^16.0.0 || ^17.0.0 || ^18.1.0",
"react-dom": "^15.3.0 || ^16.0.0 || ^17.0.0 || ^18.1.0"
}
Expand Down
1 change: 0 additions & 1 deletion react-formio.d.ts

This file was deleted.

Loading