-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: [CGC-15] Resolve TypeScript and lint errors (#8)
- Loading branch information
1 parent
03123d0
commit bfb1aee
Showing
20 changed files
with
1,483 additions
and
1,220 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,3 @@ | ||
/build/** | ||
tailwind.css | ||
/src/locales/** |
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,153 @@ | ||
{ | ||
"parserOptions": { | ||
"ecmaVersion": "latest", | ||
"sourceType": "module" | ||
}, | ||
"plugins": [ | ||
"@typescript-eslint", | ||
"react", | ||
"react-hooks" | ||
], | ||
"extends": [ | ||
"airbnb", | ||
"eslint:recommended", | ||
"plugin:@typescript-eslint/recommended" | ||
], | ||
"env": { | ||
"browser": true, | ||
"es2021": true | ||
}, | ||
"globals": { | ||
"cy": true, | ||
"before": true, | ||
"beforeEach": true, | ||
"describe": true, | ||
"document": true, | ||
"window": true, | ||
"it": true, | ||
"expect": true, | ||
"appPackage": true, | ||
"Cypress": true | ||
}, | ||
"settings": { | ||
"import/core-modules": ["@dhis2/d2-i18n", "react"], | ||
"import/resolver": { | ||
"node": { | ||
"extensions": [".js", ".jsx", ".ts", ".tsx"] | ||
} | ||
}, | ||
"import/ignore": [ | ||
"node_modules", | ||
".(json|css)$" | ||
] | ||
}, | ||
"rules": { | ||
"indent": [2, 4], | ||
"complexity": "off", | ||
"no-prototype-builtins": "off", | ||
"no-redeclare": "error", | ||
"no-plusplus": ["error", { "allowForLoopAfterthoughts": true }], | ||
"jsx-quotes": ["error", "prefer-single"], | ||
"no-console": ["error", { | ||
"allow": ["warn", "error"] | ||
}], | ||
"comma-dangle": [ | ||
"error", | ||
{ | ||
"arrays": "always-multiline", | ||
"objects": "always-multiline", | ||
"imports": "always-multiline", | ||
"exports": "always-multiline", | ||
"functions": "always-multiline" | ||
} | ||
], | ||
"no-multi-spaces": ["error", { "ignoreEOLComments": true }], | ||
"no-return-assign": ["error", "except-parens"], | ||
"react/jsx-indent": [1, 4], | ||
"@typescript-eslint/ban-ts-comment": "off", | ||
"@typescript-eslint/no-explicit-any": "off", | ||
"implicit-arrow-linebreak": "off", | ||
"react/jsx-indent-props": [2, 4], | ||
"react/prefer-es6-class": [1, "always"], | ||
"react/jsx-filename-extension": [1, { "extensions": [".ts", ".tsx"] }], | ||
"react/no-unused-prop-types": [2, { "skipShapeProps": true }], | ||
"react/forbid-prop-types": [0], | ||
"@typescript-eslint/no-unnecessary-type-constraint": "warn", | ||
"no-param-reassign": 0, | ||
"react/prop-types": 0, | ||
"import/prefer-default-export": 0, | ||
"react/prefer-stateless-function": 0, | ||
"no-unused-expressions": 0, | ||
"linebreak-style": "off", | ||
"@typescript-eslint/no-unused-vars": "error", | ||
"react/jsx-no-bind": 0, | ||
"react/require-default-props": 0, | ||
"react/jsx-curly-brace-presence": 0, | ||
"react/function-component-definition": 0, | ||
"@typescript-eslint/no-empty-function": "off", | ||
"import/no-extraneous-dependencies": [ | ||
"error", | ||
{ | ||
"devDependencies": [ | ||
"**/*.test.js", | ||
"cypress/**", | ||
"cypress.config.ts" | ||
], | ||
"optionalDependencies": false, | ||
"peerDependencies": true | ||
} | ||
], | ||
"react/button-has-type": 0, | ||
"react/sort-comp": [ | ||
2, | ||
{ | ||
"order": [ | ||
"static-methods", | ||
"type-annotations", | ||
"lifecycle", | ||
"everything-else", | ||
"render" | ||
], | ||
"groups": { | ||
"lifecycle": [ | ||
"displayName", | ||
"propTypes", | ||
"contextTypes", | ||
"childContextTypes", | ||
"mixins", | ||
"statics", | ||
"defaultProps", | ||
"constructor", | ||
"getDefaultProps", | ||
"getInitialState", | ||
"state", | ||
"getChildContext", | ||
"UNSAFE_componentWillMount", | ||
"componentDidMount", | ||
"UNSAFE_componentWillReceiveProps", | ||
"shouldComponentUpdate", | ||
"UNSAFE_componentWillUpdate", | ||
"componentDidUpdate", | ||
"componentWillUnmount" | ||
] | ||
} | ||
} | ||
], | ||
"react-hooks/exhaustive-deps": "error", | ||
"object-curly-newline": [ | ||
"error", | ||
{ | ||
"ObjectExpression": { "multiline": true, "minProperties": 3 }, | ||
"ObjectPattern": { "multiline": true, "minProperties": 4 }, | ||
"ImportDeclaration": "never", | ||
"ExportDeclaration": { "multiline": true, "minProperties": 3 } | ||
} | ||
], | ||
"max-len": ["error", { "code": 120 }], | ||
"no-shadow": "off", | ||
"react/jsx-props-no-spreading": "off", | ||
"camelcase": "off", | ||
"import/extensions": ["error", "never"] | ||
} | ||
} | ||
|
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,9 +1,7 @@ | ||
const config = { | ||
type: 'app', | ||
|
||
entryPoints: { | ||
plugin: './src/Plugin.tsx' | ||
}, | ||
} | ||
entryPoints: { plugin: './src/Plugin.tsx' }, | ||
}; | ||
|
||
module.exports = config | ||
module.exports = config; |
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,20 +1,18 @@ | ||
import React from 'react' | ||
import Plugin from "./Plugin"; | ||
import React from 'react'; | ||
import Plugin from './Plugin'; | ||
import './tailwind.css'; | ||
import './index.css'; | ||
|
||
const query = { | ||
me: { | ||
resource: 'me', | ||
}, | ||
} | ||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
const query = { me: { resource: 'me' } }; | ||
|
||
const MyApp = () => ( | ||
// eslint-disable-next-line react/jsx-filename-extension | ||
<div> | ||
<Plugin | ||
pluginSource={'http://localhost:3002/plugin.html'} | ||
/> | ||
</div> | ||
) | ||
); | ||
|
||
export default MyApp | ||
export default MyApp; |
This file was deleted.
Oops, something went wrong.
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
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 +1 @@ | ||
export { GrowthChartBuilder } from './GrowthChartBuilder' | ||
export { GrowthChartBuilder } from './GrowthChartBuilder'; |
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,3 +1,4 @@ | ||
export const useRangeTimePeriode = (start: number, end: number) => { | ||
return Array.from({ length: end - start + 1 }, (_, index) => start + index); | ||
}; | ||
export const useRangeTimePeriode = (start: number, end: number) => Array.from( | ||
{ length: end - start + 1 }, | ||
(_, index) => start + index, | ||
); |
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 +1 @@ | ||
export { IconButton } from "./IconButton"; | ||
export { IconButton } from './IconButton'; |
Oops, something went wrong.