-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(typescript): add typesript support
BREAKING CHANGE: .eslintrc -> .eslintrc.js, entryFilenameJs & entryFilenameTs options added in wm-config.js
- Loading branch information
Showing
9 changed files
with
344 additions
and
63 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,61 @@ | ||
const typescript = require('./wm-config').typescript | ||
|
||
module.exports = { | ||
"root": true, | ||
...(typescript ? { "parser": "@typescript-eslint/parser" } : {}), | ||
"plugins": [ | ||
typescript && "@typescript-eslint" | ||
].filter(Boolean), | ||
"env": { | ||
"browser": true, | ||
"es2021": true, | ||
"node": true, | ||
"worker": true | ||
}, | ||
"extends": [ | ||
"eslint:recommended", | ||
"plugin:react/recommended", | ||
"plugin:react-hooks/recommended" | ||
], | ||
"extends": [ | ||
"eslint:recommended", | ||
typescript && "plugin:@typescript-eslint/recommended", | ||
"plugin:react/recommended", | ||
"plugin:react-hooks/recommended" | ||
].filter(Boolean), | ||
"parserOptions": { | ||
"sourceType": "module", | ||
"requireConfigFile": false | ||
}, | ||
"rules": { | ||
...(typescript ? { | ||
"@typescript-eslint/no-use-before-define": [ | ||
"error", | ||
{ | ||
"functions": false | ||
} | ||
] | ||
} : { | ||
"no-use-before-define": [ | ||
"error", | ||
{ | ||
"functions": false | ||
} | ||
], | ||
"no-unused-vars": "warn", | ||
}), | ||
"react/react-in-jsx-scope": "off" | ||
}, | ||
"globals": { | ||
"process": "readonly" | ||
}, | ||
"settings": { | ||
"react": { | ||
"version": "detect" | ||
} | ||
}, | ||
"ignorePatterns": [ | ||
"/**/*.*", | ||
"!src/**/*.*" | ||
] | ||
} |
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,20 @@ | ||
/** images */ | ||
|
||
declare module "*.avif" | ||
declare module "*.gif" | ||
declare module "*.apng" | ||
declare module '*.png' | ||
declare module "*.jpg" | ||
declare module "*.jpeg" | ||
declare module "*.jfif" | ||
declare module "*.pjpeg" | ||
declare module "*.pjp" | ||
declare module "*.svg" | ||
declare module "*.webp" | ||
|
||
/** svg as react component */ | ||
declare module "*.svg?react" | ||
|
||
/** other */ | ||
|
||
declare module "*.txt" |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.