Add Typescript linting to qa:lint-javascript command

[MAILPOET-2658]
This commit is contained in:
Amine Ben hammou
2020-02-27 02:05:07 +01:00
committed by Jack Kitterhing
parent 20909f0912
commit 0ceac8921f
4 changed files with 11 additions and 9 deletions

View File

@@ -363,7 +363,7 @@ class RoboFile extends \Robo\Tasks {
}
public function qaLintJavascript() {
return $this->_exec('npm run lint');
return $this->_exec('npm run check-types && npm run lint');
}
public function qaLintCss() {

View File

@@ -4,13 +4,13 @@ import MailPoet from 'mailpoet';
type Props = {
type: 'success' | 'info' | 'warning' | 'error';
scroll: boolean;
closable: boolean;
renderInPlace: boolean;
children: ReactNode;
scroll?: boolean;
closable?: boolean;
renderInPlace?: boolean;
onDisplay?: () => void;
onClose?: () => void;
timeout: number | false;
children: ReactNode;
timeout?: number | false;
};
const Notice: FC<Props> = ({

View File

@@ -10,7 +10,7 @@
"not dead"
],
"scripts": {
"lint": "npm run lint6 && npm run lint5 && npm run lint-tests",
"lint": "npm run lint6 && npm run lint-ts && npm run lint5 && npm run lint-tests",
"lint6": "eslint -c .eslintrc.es6.json --max-warnings 0 'assets/js/src/**/*.jsx' 'tests/javascript/**/*.js'",
"lint-ts": "eslint -c .eslintrc.ts.json --max-warnings 0 'assets/js/src/**/*.tsx' 'assets/js/src/**/*.ts'",
"lint5": "eslint -c .eslintrc.es5.json --ignore-pattern helpscout.js --max-warnings 0 'assets/js/src/**/*.js'",
@@ -18,7 +18,8 @@
"autoprefixer": "postcss assets/dist/css/*.css --use autoprefixer --no-map --replace",
"scss": "node-sass assets/css/src/ --output assets/dist/css/ --output-style compact",
"stylelint": "stylelint --fix",
"test": "mocha --require @babel/register tests/javascript/**/*.spec.js"
"test": "mocha --require @babel/register tests/javascript/**/*.spec.js",
"check-types": "tsc --noEmit"
},
"dependencies": {
"@babel/runtime": "^7.8.4",

View File

@@ -20,8 +20,10 @@
"strictPropertyInitialization": false, /* Enable strict checking of property initialization in classes. */
"noImplicitThis": false, /* Raise error on 'this' expressions with an implied 'any' type. */
"alwaysStrict": false, /* Parse in strict mode and emit "use strict" for each source file. */
"moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
// "allowJs": true, /* Allow javascript files to be compiled. */
// "checkJs": true, /* Report errors in .js files. */
// "incremental": true, /* Enable incremental compilation */
// "lib": [], /* Specify library files to be included in the compilation. */
// "declaration": true, /* Generates corresponding '.d.ts' file. */
@@ -43,7 +45,6 @@
// "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
/* Module Resolution Options */
"moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
// "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
// "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
// "typeRoots": [], /* List of folders to include type definitions from. */