зеркало из https://github.com/microsoft/reactxp.git
Replace TSLint on ESLint (#1172)
This commit is contained in:
Родитель
fb9504c354
Коммит
5dafd2b109
|
@ -0,0 +1,25 @@
|
|||
{
|
||||
"parserOptions": {
|
||||
"project": "./tsconfig.json"
|
||||
},
|
||||
"extends": ["skype"],
|
||||
"rules": {},
|
||||
"overrides": [
|
||||
{
|
||||
"files": [
|
||||
"*.tsx"
|
||||
],
|
||||
"rules": {
|
||||
"@typescript-eslint/explicit-function-return-type": "off"
|
||||
}
|
||||
},
|
||||
{
|
||||
"files": [
|
||||
"PluginBaseChecker.ts"
|
||||
],
|
||||
"rules": {
|
||||
"@typescript-eslint/no-unused-vars": "off"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
|
@ -5,23 +5,25 @@
|
|||
"author": "ReactXP Team <reactxp@microsoft.com>",
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"build": "npm run tslint && tsc",
|
||||
"tslint": "tslint -p tsconfig.json -r tslint.json -r ./node_modules/tslint-microsoft-contrib --fix || true"
|
||||
"build": "tsc",
|
||||
"lint": "eslint --ext .ts,.tsx src",
|
||||
"lint:fix": "npm run lint -- --fix"
|
||||
},
|
||||
"dependencies": {
|
||||
"@react-native-community/netinfo": "^4.6.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"reactxp": "^2.0.0",
|
||||
"react-dom": "^16.3",
|
||||
"react-native": ">=0.57",
|
||||
"react-native-windows": "^0.57.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@typescript-eslint/eslint-plugin": "2.15.0",
|
||||
"eslint": "6.8.0",
|
||||
"eslint-config-skype": "1.5.0",
|
||||
"eslint-plugin-import": "2.19.1",
|
||||
"reactxp": "^2.0.0",
|
||||
"typescript": "3.7.2",
|
||||
"tslint": "5.20.1",
|
||||
"tslint-microsoft-contrib": "6.2.0"
|
||||
"typescript": "3.7.4"
|
||||
},
|
||||
"types": "dist/web/PluginBase.d.ts"
|
||||
}
|
||||
|
|
|
@ -7,17 +7,16 @@
|
|||
* Type check all the pluginbase exports against the desired interface.
|
||||
*/
|
||||
|
||||
import * as Interfaces from './Interfaces';
|
||||
import * as AndroidPlugin from '../android/PluginBase';
|
||||
import * as iOSPlugin from '../ios/PluginBase';
|
||||
import * as macOSPlugin from '../macos/PluginBase';
|
||||
import * as WebPlugin from '../web/PluginBase';
|
||||
import * as WindowsPlugin from '../windows/PluginBase';
|
||||
|
||||
/* tslint:disable:no-unused-variable */
|
||||
import * as Interfaces from './Interfaces';
|
||||
|
||||
const _typeCheckerAndroid: Interfaces.PluginInterface = AndroidPlugin;
|
||||
const _typeCheckeriOS: Interfaces.PluginInterface = iOSPlugin;
|
||||
const _typeCheckermacOS: Interfaces.PluginInterface = macOSPlugin;
|
||||
const _typeCheckerWeb: Interfaces.PluginInterface = WebPlugin;
|
||||
const _typeCheckerWindows: Interfaces.PluginInterface = WindowsPlugin;
|
||||
/* tslint:enable:no-unused-variable */
|
||||
|
|
|
@ -24,17 +24,13 @@ export class NetInfo extends Interfaces.NetInfo {
|
|||
}
|
||||
|
||||
isConnected(): Promise<boolean> {
|
||||
return RNNetInfo.fetch().then((state: RNNetInfo.NetInfoState) => {
|
||||
return state.isConnected;
|
||||
}).catch(() => {
|
||||
return Promise.reject('NetInfo.isConnected.fetch() failed');
|
||||
});
|
||||
return RNNetInfo.fetch()
|
||||
.then((state: RNNetInfo.NetInfoState) => state.isConnected)
|
||||
.catch(() => Promise.reject('NetInfo.isConnected.fetch() failed'));
|
||||
}
|
||||
|
||||
getType(): Promise<Types.DeviceNetworkType> {
|
||||
return RNNetInfo.fetch().then((state: RNNetInfo.NetInfoState) => {
|
||||
return NetInfo._getNetworkTypeFromConnectionInfo(state);
|
||||
});
|
||||
return RNNetInfo.fetch().then((state: RNNetInfo.NetInfoState) => NetInfo._getNetworkTypeFromConnectionInfo(state));
|
||||
}
|
||||
|
||||
private static _getNetworkTypeFromConnectionInfo(state: RNNetInfo.NetInfoState): Types.DeviceNetworkType {
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
*/
|
||||
|
||||
import * as Types from '../common/Types';
|
||||
|
||||
import NetInfo from './NetInfo';
|
||||
|
||||
export { NetInfo as default, Types };
|
||||
|
|
|
@ -1,21 +1,20 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"declaration": true,
|
||||
"noResolve": false,
|
||||
"jsx": "react",
|
||||
"module": "commonjs",
|
||||
"target": "es5",
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"strictPropertyInitialization": true,
|
||||
"experimentalDecorators": true,
|
||||
"noImplicitReturns": true,
|
||||
"strictNullChecks": true,
|
||||
"noImplicitThis": true,
|
||||
"noImplicitAny": true,
|
||||
"skipLibCheck": true,
|
||||
"strict": true,
|
||||
"outDir": "dist/",
|
||||
"lib": [
|
||||
"es2015.promise",
|
||||
"es5",
|
||||
"dom"
|
||||
],
|
||||
"types" : ["lodash", "react", "react-dom", "react-native"]
|
||||
"declaration": true,
|
||||
"noResolve": false,
|
||||
"target": "es5",
|
||||
"module": "commonjs",
|
||||
"outDir": "dist",
|
||||
"jsx": "react",
|
||||
"lib": ["es2015.promise", "es5", "DOM"]
|
||||
},
|
||||
|
||||
"include": [
|
||||
|
@ -23,7 +22,7 @@
|
|||
],
|
||||
|
||||
"exclude": [
|
||||
"dist",
|
||||
"node_modules"
|
||||
"node_modules",
|
||||
"dist"
|
||||
]
|
||||
}
|
|
@ -1,49 +0,0 @@
|
|||
{
|
||||
"rules": {
|
||||
"align": [true, "statements"],
|
||||
"class-name": true,
|
||||
"curly": true,
|
||||
"eofline": true,
|
||||
"forin": true,
|
||||
"indent": [true, "spaces"],
|
||||
"interface-name": [true, "never-prefix"],
|
||||
"label-position": true,
|
||||
"max-line-length": [ true, 140 ],
|
||||
"no-arg": true,
|
||||
"no-bitwise": false,
|
||||
"no-console": [true,
|
||||
"debug",
|
||||
"info",
|
||||
"time",
|
||||
"timeEnd",
|
||||
"trace"
|
||||
],
|
||||
"no-consecutive-blank-lines": true,
|
||||
"no-construct": true,
|
||||
"no-debugger": true,
|
||||
"no-duplicate-variable": true,
|
||||
"no-empty": true,
|
||||
"no-eval": true,
|
||||
"no-switch-case-fall-through": true,
|
||||
"no-trailing-whitespace": false,
|
||||
"no-unused-expression": true,
|
||||
"one-line": [true,
|
||||
"check-open-brace",
|
||||
"check-catch",
|
||||
"check-else",
|
||||
"check-whitespace"
|
||||
],
|
||||
"quotemark": [true, "single", "jsx-single"],
|
||||
"radix": true,
|
||||
"semicolon": true,
|
||||
"triple-equals": [true, "allow-null-check"],
|
||||
"variable-name": false,
|
||||
"whitespace": [true,
|
||||
"check-branch",
|
||||
"check-decl",
|
||||
"check-operator",
|
||||
"check-separator",
|
||||
"check-type"
|
||||
]
|
||||
}
|
||||
}
|
Загрузка…
Ссылка в новой задаче