Skip to content
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

FIO 8552: add modern linting, formatting, precommit hooks #5941

Draft
wants to merge 14 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ workflows:
- build:
filters:
branches:
ignore: /.*/
ignore: /.*/
10 changes: 0 additions & 10 deletions .eslintignore

This file was deleted.

17 changes: 0 additions & 17 deletions .eslintrc.js

This file was deleted.

2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

**Describe the bug**
Expand All @@ -15,6 +14,7 @@ What release version or branch are you experiencing the behavior

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

1. Create form...
2. Add component...
3. Use form...
Expand Down
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
10 changes: 5 additions & 5 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,23 @@ 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:

Expand Down
1 change: 0 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ jobs:
restore-keys: |
${{ runner.os }}-node-


- name: Installing dependencies
if: steps.cache.outputs.cache-hit != 'true'
uses: borales/actions-yarn@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ jobs:
- name: Release
uses: borales/actions-yarn@v4
with:
cmd: release
cmd: release
1 change: 1 addition & 0 deletions .husky/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npx lint-staged
8 changes: 8 additions & 0 deletions .mocharc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
process.env.TZ = 'UTC';

module.exports = {
bail: true,
timeout: 20000,
exit: true,
require: ['ts-node/register', 'mock-local-storage', 'jsdom-global/register'],
};
12 changes: 0 additions & 12 deletions .mocharc.js

This file was deleted.

17 changes: 17 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/node_modules/
/dist/
/build/
/lib/
/artifacts/
/coverage/
/docs/
/_layouts/
/_site/
/.circleci/,
/.github/,
/.husky/,
/.jekyll-cache/,
/.nyc_output/,
/.vscode/,
/.git/
/test/renders/
4 changes: 4 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"singleQuote": true,
"printWidth": 100
}
88 changes: 39 additions & 49 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,51 +1,41 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Mocha Tests",
"program": "${workspaceFolder}/node_modules/mocha/bin/_mocha",
"args": [
"-b",
"-t",
"0",
"--colors",
"${workspaceFolder}/test/**/*.unit.js",
"-t",
"30000"
],
"internalConsoleOptions": "openOnSessionStart",
"skipFiles": [
"<node_internals>/**"
]
},
{
"type": "node",
"request": "launch",
"name": "Launch Mocha Tests via Yarn",
"runtimeExecutable": "yarn",
"cwd": "${workspaceFolder}",
"runtimeArgs": ["test"],
},
{
"type": "node",
"request": "launch",
"name": "Update Renders via Yarn",
"runtimeExecutable": "yarn",
"cwd": "${workspaceFolder}",
"runtimeArgs": ["test:updateRenders"],
},
{
"type": "node",
"request": "launch",
"name": "Mocha: current file",
"program": "${workspaceFolder}/node_modules/.bin/mocha",
"args": ["-b", "-t", "0", "'${file}'"],
"console": "integratedTerminal",
},
]
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Mocha Tests",
"program": "${workspaceFolder}/node_modules/mocha/bin/_mocha",
"args": ["-b", "-t", "0", "--colors", "${workspaceFolder}/test/**/*.unit.js", "-t", "30000"],
"internalConsoleOptions": "openOnSessionStart",
"skipFiles": ["<node_internals>/**"]
},
{
"type": "node",
"request": "launch",
"name": "Launch Mocha Tests via Yarn",
"runtimeExecutable": "yarn",
"cwd": "${workspaceFolder}",
"runtimeArgs": ["test"]
},
{
"type": "node",
"request": "launch",
"name": "Update Renders via Yarn",
"runtimeExecutable": "yarn",
"cwd": "${workspaceFolder}",
"runtimeArgs": ["test:updateRenders"]
},
{
"type": "node",
"request": "launch",
"name": "Mocha: current file",
"program": "${workspaceFolder}/node_modules/.bin/mocha",
"args": ["-b", "-t", "0", "'${file}'"],
"console": "integratedTerminal"
}
]
}
Loading