-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from Flagsmith/chore/add-linting
chore: add linting
- Loading branch information
Showing
18 changed files
with
10,082 additions
and
9,953 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
"parserOptions": { | ||
"sourceType": "module", | ||
"ecmaVersion": 2017, | ||
"ecmaFeatures": { | ||
"jsx": true | ||
} | ||
}, | ||
"plugins": ["react-hooks"], | ||
"extends": [ | ||
"eslint:recommended", | ||
"plugin:react/recommended", | ||
"plugin:react/jsx-runtime", | ||
"plugin:@typescript-eslint/recommended" | ||
], | ||
"rules": { | ||
"@typescript-eslint/no-explicit-any": "warn", | ||
"@typescript-eslint/no-unused-vars": "warn", | ||
"react-hooks/rules-of-hooks": "error", | ||
"react/display-name": "off" | ||
}, | ||
"settings": { | ||
"react": { | ||
"version": "17" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
name: Lint with pre-commit | ||
|
||
on: | ||
pull_request: | ||
|
||
jobs: | ||
pre-commit: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-python@v4 | ||
- uses: pre-commit/[email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.4.0 | ||
hooks: | ||
- id: check-yaml | ||
- id: check-json | ||
- id: check-toml | ||
|
||
- repo: https://github.com/pre-commit/mirrors-prettier | ||
rev: v3.0.0 | ||
hooks: | ||
- id: prettier | ||
|
||
- repo: https://github.com/pre-commit/mirrors-eslint | ||
rev: v8.55.0 | ||
hooks: | ||
- id: eslint | ||
additional_dependencies: | ||
- [email protected] | ||
- [email protected] | ||
- [email protected] | ||
- [email protected] | ||
exclude: | | ||
(?x)^( | ||
package.json| | ||
tests/.* | ||
)$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
package.json | ||
package-lock.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"printWidth": 100 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,21 @@ | ||
Copyright 2023 Bullet Train Ltd | ||
|
||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: | ||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the | ||
following conditions are met: | ||
|
||
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. | ||
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following | ||
disclaimer. | ||
|
||
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. | ||
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following | ||
disclaimer in the documentation and/or other materials provided with the distribution. | ||
|
||
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. | ||
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products | ||
derived from this software without specific prior written permission. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, | ||
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | ||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, | ||
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | ||
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,40 @@ | ||
# Use Atlassian Forge | ||
|
||
* Status: Accepted | ||
- Status: Accepted | ||
|
||
## Context and Problem Statement | ||
|
||
Need to choose a development platform which allows UI modules to be added to Jira and to be distributed as an app in the Atlassian Marketplace. | ||
Need to choose a development platform which allows UI modules to be added to Jira and to be distributed as an app in the | ||
Atlassian Marketplace. | ||
|
||
## Decision Drivers | ||
|
||
* Overall requirement to quickly tick the box that Flagsmith has a Jira integration and offer MVP functionality which can be iterated on later. | ||
- Overall requirement to quickly tick the box that Flagsmith has a Jira integration and offer MVP functionality which | ||
can be iterated on later. | ||
|
||
## Considered Options | ||
|
||
* Atlassian Forge (newer mechanism, app hosted by Atlassian) | ||
* Atlassian Connect (older mechanism, iframe only, app hosted by Flagsmith) | ||
- Atlassian Forge (newer mechanism, app hosted by Atlassian) | ||
- Atlassian Connect (older mechanism, iframe only, app hosted by Flagsmith) | ||
|
||
## Decision Outcome | ||
|
||
Chosen option: "Atlassian Forge", because it allows for faster development of an app that meets requirements with capacity to scale to meet future requirements. | ||
Chosen option: "Atlassian Forge", because it allows for faster development of an app that meets requirements with | ||
capacity to scale to meet future requirements. | ||
|
||
### Positive Consequences | ||
|
||
* Use of recommended platform with roadmap | ||
* Built-in authentication, sandboxing, and hosting environments | ||
* Built-in console to manage, distribute, and monitor apps | ||
* CLI tooling for testing, deployment and installation | ||
* Allows for Connect-style iframe apps if required | ||
- Use of recommended platform with roadmap | ||
- Built-in authentication, sandboxing, and hosting environments | ||
- Built-in console to manage, distribute, and monitor apps | ||
- CLI tooling for testing, deployment and installation | ||
- Allows for Connect-style iframe apps if required | ||
|
||
### Negative Consequences | ||
|
||
* Limited to JavaScript/TypeScript but that is the UI stack we use anyway | ||
* Less control over (but less responsibility for) hosting as it is provided by Atlassian | ||
- Limited to JavaScript/TypeScript but that is the UI stack we use anyway | ||
- Less control over (but less responsibility for) hosting as it is provided by Atlassian | ||
|
||
## Links | ||
|
||
* https://developer.atlassian.com/developer-guide/cloud-development-options/ | ||
- https://developer.atlassian.com/developer-guide/cloud-development-options/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,41 @@ | ||
# Use Current Forge Runtime | ||
|
||
* Status: Accepted | ||
- Status: Accepted | ||
|
||
## Context and Problem Statement | ||
|
||
Need to choose a JavaScript runtime that executes the app code and provides libraries for Jira and Flagsmith REST API calls, storage, authorisation, etc. | ||
Need to choose a JavaScript runtime that executes the app code and provides libraries for Jira and Flagsmith REST API | ||
calls, storage, authorisation, etc. | ||
|
||
## Decision Drivers | ||
|
||
* Overall requirement to quickly tick the box that Flagsmith has a Jira integration and offer MVP functionality which can be iterated on later. | ||
- Overall requirement to quickly tick the box that Flagsmith has a Jira integration and offer MVP functionality which | ||
can be iterated on later. | ||
|
||
## Considered Options | ||
|
||
* Current runtime (limited Node.js 14, generally available) | ||
* Native runtime (full Node.js 18, in preview) | ||
- Current runtime (limited Node.js 14, generally available) | ||
- Native runtime (full Node.js 18, in preview) | ||
|
||
## Decision Outcome | ||
|
||
Chosen option: "Current runtime", while avoiding falling into any of the breaking changes between the runtimes, i.e. use latest Forge libraries, set Content-Type on API calls, don't rely on snapshotting. This allows for faster, more reliable, development without ruling out a future change of runtime. | ||
Chosen option: "Current runtime", while avoiding falling into any of the breaking changes between the runtimes, i.e. use | ||
latest Forge libraries, set Content-Type on API calls, don't rely on snapshotting. This allows for faster, more | ||
reliable, development without ruling out a future change of runtime. | ||
|
||
### Positive Consequences | ||
|
||
* Stability as preview releases are subject to change | ||
* Reliable tunnelling as local environment is same as deployment environment | ||
* Ability to use runtime features (e.g. debugging) not yet available in new runtime | ||
* Avoids confusion between Forge CLI Node.js (20) and Runtime Node.js (18) | ||
* Minimal obstacles to migrate to the new runtime later | ||
- Stability as preview releases are subject to change | ||
- Reliable tunnelling as local environment is same as deployment environment | ||
- Ability to use runtime features (e.g. debugging) not yet available in new runtime | ||
- Avoids confusion between Forge CLI Node.js (20) and Runtime Node.js (18) | ||
- Minimal obstacles to migrate to the new runtime later | ||
|
||
### Negative Consequences | ||
|
||
* Potentially slower but should be fast enough, if not we can re-evaluate this decision | ||
* Less Node features in the older runtime but we don't need them now | ||
- Potentially slower but should be fast enough, if not we can re-evaluate this decision | ||
- Less Node features in the older runtime but we don't need them now | ||
|
||
## Links | ||
|
||
* https://developer.atlassian.com/platform/forge/runtime-reference/native-nodejs-runtime/ | ||
- https://developer.atlassian.com/platform/forge/runtime-reference/native-nodejs-runtime/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,45 @@ | ||
# Use UI Kit | ||
|
||
* Status: Accepted | ||
- Status: Accepted | ||
|
||
## Context and Problem Statement | ||
|
||
Need to choose a JavaScript library for UI components (text, tables, inputs, buttons, etc) and Jira UI (app settings, project settings, issue panel, menus, modals, etc). | ||
Need to choose a JavaScript library for UI components (text, tables, inputs, buttons, etc) and Jira UI (app settings, | ||
project settings, issue panel, menus, modals, etc). | ||
|
||
## Decision Drivers | ||
|
||
* Overall requirement to quickly tick the box that Flagsmith has a Jira integration and offer MVP functionality which can be iterated on later. | ||
- Overall requirement to quickly tick the box that Flagsmith has a Jira integration and offer MVP functionality which | ||
can be iterated on later. | ||
|
||
## Considered Options | ||
|
||
* UI Kit (original Jira UI component library) | ||
* UI Kit 2 (updated library, under development, in preview) | ||
* Custom UI (provide own UI components, use bridge to Jira components) | ||
- UI Kit (original Jira UI component library) | ||
- UI Kit 2 (updated library, under development, in preview) | ||
- Custom UI (provide own UI components, use bridge to Jira components) | ||
|
||
## Decision Outcome | ||
|
||
Chosen option: "UI Kit", because it offers the simplest route to developing an MVP UI without ruling out more complex UI in future. Keep UI and business logic code separate and avoid using withdrawn UI Kit features to minimise barriers to transition. | ||
Chosen option: "UI Kit", because it offers the simplest route to developing an MVP UI without ruling out more complex UI | ||
in future. Keep UI and business logic code separate and avoid using withdrawn UI Kit features to minimise barriers to | ||
transition. | ||
|
||
### Positive Consequences | ||
|
||
* Stability as preview releases are subject to change | ||
* Reduced complexity as UI Kit 2 requires new native runtime and splits execution between frontend and backend | ||
* Reduced effort as UI Kit provides pre-built UI components styled to fit with Jira | ||
* Greater compatibility as UI Kit is expected to work well with Jira styling features such as dark mode | ||
* Minimal obstacles to migrate to UI Kit 2 later | ||
- Stability as preview releases are subject to change | ||
- Reduced complexity as UI Kit 2 requires new native runtime and splits execution between frontend and backend | ||
- Reduced effort as UI Kit provides pre-built UI components styled to fit with Jira | ||
- Greater compatibility as UI Kit is expected to work well with Jira styling features such as dark mode | ||
- Minimal obstacles to migrate to UI Kit 2 later | ||
|
||
### Negative Consequences | ||
|
||
* Less control over UI, but assuming it looks no worse than competing integrations, that should meet requirements, if not we can re-evaluate this decision | ||
- Less control over UI, but assuming it looks no worse than competing integrations, that should meet requirements, if | ||
not we can re-evaluate this decision | ||
|
||
## Links | ||
|
||
* https://developer.atlassian.com/platform/forge/ui-kit-components/ | ||
* https://developer.atlassian.com/platform/forge/ui-kit-2/ | ||
* https://developer.atlassian.com/platform/forge/custom-ui/iframe/ | ||
* https://trello.com/b/z2GIJ3xD/forge-roadmap-for-developers | ||
- https://developer.atlassian.com/platform/forge/ui-kit-components/ | ||
- https://developer.atlassian.com/platform/forge/ui-kit-2/ | ||
- https://developer.atlassian.com/platform/forge/custom-ui/iframe/ | ||
- https://trello.com/b/z2GIJ3xD/forge-roadmap-for-developers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.