-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: update init command to cater for TS project configurations
- add custom declaration files for React and CSS modules - install relevant type definitions: react, jest, etc - add eslint config file and install eslint dependencies
- Loading branch information
Showing
7 changed files
with
106 additions
and
16 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 @@ | ||
// eslint-disable-next-line @typescript-eslint/no-var-requires | ||
const { config } = require('@dhis2/cli-style') | ||
|
||
module.exports = { | ||
extends: [ | ||
config.eslintReact, | ||
'plugin:@typescript-eslint/recommended', | ||
'plugin:import/typescript', | ||
], | ||
settings: { | ||
'import/resolver': { | ||
node: { | ||
extensions: ['.js', '.jsx', '.ts', '.tsx'], | ||
}, | ||
}, | ||
}, | ||
globals: { | ||
cy: 'readonly', | ||
Cypress: 'readonly', | ||
}, | ||
rules: { | ||
'react/prop-types': 'off', | ||
'react/display-name': 'off', | ||
'import/extensions': 'off', | ||
'@typescript-eslint/no-explicit-any': 'off', | ||
}, | ||
} |
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import 'react' | ||
|
||
declare module 'react' { | ||
interface StyleHTMLAttributes<T> extends React.HTMLAttributes<T> { | ||
jsx?: boolean | ||
global?: boolean | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
declare module '*.module.css' { | ||
interface Classes { | ||
[key: string]: string | ||
} | ||
const classes: Classes | ||
export default classes | ||
} |
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