Allow typescript files

Change-type: patch
Changelog-entry: Allow typescript files
This commit is contained in:
Alexis Svinartchouk 2019-06-06 13:43:04 +02:00
parent 86238af380
commit 0a0be3a13d
6 changed files with 894 additions and 197 deletions

1
.gitattributes vendored
View File

@ -1,4 +1,5 @@
# Javascript files must retain LF line-endings (to keep eslint happy)
*.ts text eol=lf
*.js text eol=lf
*.jsx text eol=lf
# CSS and SCSS files must retain LF line-endings (to keep ensure-staged-sass.sh happy)

View File

@ -150,6 +150,9 @@ sass:
npm rebuild node-sass
node-sass lib/gui/app/scss/main.scss > lib/gui/css/main.css
lint-ts:
resin-lint --typescript lib
lint-js:
eslint --ignore-pattern scripts/resin/**/*.js lib tests scripts bin webpack.config.js
@ -169,7 +172,7 @@ lint-spell:
--skip *.svg *.gz,*.bz2,*.xz,*.zip,*.img,*.dmg,*.iso,*.rpi-sdcard,*.wic,.DS_Store,*.dtb,*.dtbo,*.dat,*.elf,*.bin,*.foo,xz-without-extension \
lib tests docs scripts Makefile *.md LICENSE
lint: lint-js lint-sass lint-cpp lint-html lint-spell
lint: lint-ts lint-js lint-sass lint-cpp lint-html lint-spell
MOCHA_OPTIONS=--recursive --reporter spec

1055
npm-shrinkwrap.json generated

File diff suppressed because it is too large Load Diff

View File

@ -20,6 +20,7 @@
},
"scripts": {
"test": "make lint test sanity-checks",
"prettier": "prettier --config ./node_modules/resin-lint/config/.prettierrc --write \"lib/**/*.ts\"",
"start": "./node_modules/.bin/electron .",
"postshrinkwrap": "node ./scripts/clean-shrinkwrap.js",
"configure": "node-gyp configure",
@ -111,10 +112,14 @@
"node-sass": "^4.7.2",
"omit-deep-lodash": "1.1.4",
"pkg": "^4.3.0",
"resin-lint": "^3.0.4",
"sass-lint": "^1.12.1",
"simple-progress-webpack-plugin": "^1.1.2",
"spectron": "^5.0.0",
"webpack": "^4.27.0",
"style-loader": "^0.23.1",
"webpack": "^4.31.0",
"ts-loader": "^6.0.2",
"typescript": "^3.5.1",
"webpack-cli": "^3.1.2",
"webpack-node-externals": "^1.7.2"
}

16
tsconfig.json Normal file
View File

@ -0,0 +1,16 @@
{
"compilerOptions": {
"noImplicitAny": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"strictNullChecks": true,
"moduleResolution": "node",
"module": "esNext",
"target": "es2017",
"jsx": "react"
},
"include": [
"lib/**/*.ts",
"typings/**/*.d.ts"
]
}

View File

@ -51,11 +51,16 @@ const commonConfig = {
use: {
loader: 'html-loader'
}
},
{
test: /\.tsx?$/,
use: 'ts-loader',
exclude: /node_modules/
}
]
},
resolve: {
extensions: [ '.js', '.jsx', '.json' ]
extensions: [ '.js', '.jsx', '.json', '.ts', '.tsx' ]
},
plugins: [
new SimpleProgressWebpackPlugin({