mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-15 11:01:21 +08:00
Co-authored-by: Martin Guillon <martin.guillon@akylas.fr>
This commit is contained in:
@ -1,10 +1,14 @@
|
|||||||
{
|
{
|
||||||
|
"extends": ["plugin:prettier/recommended"],
|
||||||
"parser": "@typescript-eslint/parser",
|
"parser": "@typescript-eslint/parser",
|
||||||
"parserOptions": {
|
"parserOptions": {
|
||||||
|
"ecmaVersion": 2018,
|
||||||
"sourceType": "module",
|
"sourceType": "module",
|
||||||
"ecmaVersion": 2015
|
"parser": "@typescript-eslint/parser",
|
||||||
|
"project": "tsconfig.eslint.json",
|
||||||
|
"warnOnUnsupportedTypeScriptVersion": false
|
||||||
},
|
},
|
||||||
"plugins": ["@nativescript"],
|
"plugins": ["prettier", "@nativescript"],
|
||||||
"rules": {
|
"rules": {
|
||||||
"@nativescript/no-nativescript-angular-imports": "warn",
|
"@nativescript/no-nativescript-angular-imports": "warn",
|
||||||
"@nativescript/no-tns-core-modules-imports": "warn",
|
"@nativescript/no-tns-core-modules-imports": "warn",
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"extends": "../../.eslintrc",
|
"extends": "../../.eslintrc.json",
|
||||||
"rules": {},
|
"rules": {},
|
||||||
"ignorePatterns": ["!**/*"],
|
"ignorePatterns": ["!**/*", "**/node_modules/**/*", "**/__tests__/**/*"],
|
||||||
"overrides": [
|
"overrides": [
|
||||||
{
|
{
|
||||||
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
|
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
|
||||||
|
@ -222,7 +222,6 @@ export function updateAccessibilityProperties(view: View): void {
|
|||||||
uiView.accessibilityTraits = a11yTraits;
|
uiView.accessibilityTraits = a11yTraits;
|
||||||
}
|
}
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
||||||
export const sendAccessibilityEvent = (): void => {};
|
export const sendAccessibilityEvent = (): void => {};
|
||||||
export const updateContentDescription = (): string | null => null;
|
export const updateContentDescription = (): string | null => null;
|
||||||
|
|
||||||
|
@ -4,7 +4,6 @@ import { AndroidActivityBackPressedEventData, AndroidActivityBundleEventData, An
|
|||||||
|
|
||||||
// TODO: explain why we need to this or remov it
|
// TODO: explain why we need to this or remov it
|
||||||
// Use requires to ensure order of imports is maintained
|
// Use requires to ensure order of imports is maintained
|
||||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
||||||
const appCommon = require('./application-common');
|
const appCommon = require('./application-common');
|
||||||
|
|
||||||
// First reexport so that app module is initialized.
|
// First reexport so that app module is initialized.
|
||||||
|
@ -4,7 +4,6 @@ import { ApplicationEventData, CssChangedEventData, LaunchEventData, LoadAppCSSE
|
|||||||
|
|
||||||
// TODO: explain why we need to this or remov it
|
// TODO: explain why we need to this or remov it
|
||||||
// Use requires to ensure order of imports is maintained
|
// Use requires to ensure order of imports is maintained
|
||||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
||||||
const { displayedEvent, exitEvent, getCssFileName, launchEvent, livesync, lowMemoryEvent, notify, on, orientationChanged, orientationChangedEvent, resumeEvent, setApplication, suspendEvent, systemAppearanceChanged, systemAppearanceChangedEvent } = require('./application-common');
|
const { displayedEvent, exitEvent, getCssFileName, launchEvent, livesync, lowMemoryEvent, notify, on, orientationChanged, orientationChangedEvent, resumeEvent, setApplication, suspendEvent, systemAppearanceChanged, systemAppearanceChangedEvent } = require('./application-common');
|
||||||
// First reexport so that app module is initialized.
|
// First reexport so that app module is initialized.
|
||||||
export * from './application-common';
|
export * from './application-common';
|
||||||
|
@ -12,7 +12,6 @@ interface IConfigPlatform {
|
|||||||
discardUncaughtJsExceptions?: boolean;
|
discardUncaughtJsExceptions?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
|
||||||
interface IConfigIOS extends IConfigPlatform {}
|
interface IConfigIOS extends IConfigPlatform {}
|
||||||
|
|
||||||
interface IConfigAndroid extends IConfigPlatform {
|
interface IConfigAndroid extends IConfigPlatform {
|
||||||
|
@ -30,7 +30,6 @@ function getActiveNetworkInfo(): android.net.NetworkInfo {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getNetworkCapabilities() {
|
function getNetworkCapabilities() {
|
||||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
const connectivityManager: any = getConnectivityManager();
|
const connectivityManager: any = getConnectivityManager();
|
||||||
const network = connectivityManager.getActiveNetwork();
|
const network = connectivityManager.getActiveNetwork();
|
||||||
@ -39,7 +38,6 @@ function getNetworkCapabilities() {
|
|||||||
return connectionType.none;
|
return connectionType.none;
|
||||||
}
|
}
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
const NetworkCapabilities = (android as any).net.NetworkCapabilities;
|
const NetworkCapabilities = (android as any).net.NetworkCapabilities;
|
||||||
|
|
||||||
@ -101,13 +99,11 @@ export function getConnectionType(): number {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function startMonitoringLegacy(connectionTypeChangedCallback) {
|
function startMonitoringLegacy(connectionTypeChangedCallback) {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
||||||
const onReceiveCallback = function onReceiveCallback(context: android.content.Context, intent: android.content.Intent) {
|
const onReceiveCallback = function onReceiveCallback(context: android.content.Context, intent: android.content.Intent) {
|
||||||
const newConnectionType = getConnectionType();
|
const newConnectionType = getConnectionType();
|
||||||
connectionTypeChangedCallback(newConnectionType);
|
connectionTypeChangedCallback(newConnectionType);
|
||||||
};
|
};
|
||||||
const zoneCallback = zonedCallback(onReceiveCallback);
|
const zoneCallback = zonedCallback(onReceiveCallback);
|
||||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
androidApp.registerBroadcastReceiver(android.net.ConnectivityManager.CONNECTIVITY_ACTION, zoneCallback);
|
androidApp.registerBroadcastReceiver(android.net.ConnectivityManager.CONNECTIVITY_ACTION, zoneCallback);
|
||||||
}
|
}
|
||||||
@ -129,21 +125,18 @@ export function startMonitoring(connectionTypeChangedCallback: (newConnectionTyp
|
|||||||
if (!networkCallback) {
|
if (!networkCallback) {
|
||||||
@NativeClass
|
@NativeClass
|
||||||
class NetworkCallbackImpl extends ConnectivityManager.NetworkCallback {
|
class NetworkCallbackImpl extends ConnectivityManager.NetworkCallback {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
||||||
onAvailable(network: android.net.Network) {
|
onAvailable(network: android.net.Network) {
|
||||||
if (notifyCallback) {
|
if (notifyCallback) {
|
||||||
notifyCallback();
|
notifyCallback();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
||||||
onCapabilitiesChanged(network: android.net.Network, networkCapabilities: android.net.NetworkCapabilities) {
|
onCapabilitiesChanged(network: android.net.Network, networkCapabilities: android.net.NetworkCapabilities) {
|
||||||
if (notifyCallback) {
|
if (notifyCallback) {
|
||||||
notifyCallback();
|
notifyCallback();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
||||||
onLost(network) {
|
onLost(network) {
|
||||||
if (notifyCallback) {
|
if (notifyCallback) {
|
||||||
notifyCallback();
|
notifyCallback();
|
||||||
@ -169,7 +162,6 @@ export function startMonitoring(connectionTypeChangedCallback: (newConnectionTyp
|
|||||||
|
|
||||||
export function stopMonitoring(): void {
|
export function stopMonitoring(): void {
|
||||||
if (android.os.Build.VERSION.SDK_INT >= 28) {
|
if (android.os.Build.VERSION.SDK_INT >= 28) {
|
||||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
const manager = getConnectivityManager();
|
const manager = getConnectivityManager();
|
||||||
if (manager && callback) {
|
if (manager && callback) {
|
||||||
|
@ -6,13 +6,11 @@ import { getNodeById } from './dom-node';
|
|||||||
import { mainThreadify } from '../utils';
|
import { mainThreadify } from '../utils';
|
||||||
|
|
||||||
// Use lazy requires for core modules
|
// Use lazy requires for core modules
|
||||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
||||||
const getAppRootView = () => require('../application').getRootView();
|
const getAppRootView = () => require('../application').getRootView();
|
||||||
|
|
||||||
let unsetValue;
|
let unsetValue;
|
||||||
function unsetViewValue(view, name) {
|
function unsetViewValue(view, name) {
|
||||||
if (!unsetValue) {
|
if (!unsetValue) {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
||||||
unsetValue = require('../ui/core/properties').unsetValue;
|
unsetValue = require('../ui/core/properties').unsetValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -14,11 +14,8 @@ function lazy<T>(action: () => T): () => T {
|
|||||||
|
|
||||||
return () => _value || (_value = action());
|
return () => _value || (_value = action());
|
||||||
}
|
}
|
||||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
||||||
const percentLengthToStringLazy = lazy<(length) => string>(() => require('../ui/styling/style-properties').PercentLength.convertToString);
|
const percentLengthToStringLazy = lazy<(length) => string>(() => require('../ui/styling/style-properties').PercentLength.convertToString);
|
||||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
||||||
const getSetPropertiesLazy = lazy<(view: ViewBase) => [string, any][]>(() => require('../ui/core/properties').getSetProperties);
|
const getSetPropertiesLazy = lazy<(view: ViewBase) => [string, any][]>(() => require('../ui/core/properties').getSetProperties);
|
||||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
||||||
const getComputedCssValuesLazy = lazy<(view: ViewBase) => [string, any][]>(() => require('../ui/core/properties').getComputedCssValues);
|
const getComputedCssValuesLazy = lazy<(view: ViewBase) => [string, any][]>(() => require('../ui/core/properties').getComputedCssValues);
|
||||||
|
|
||||||
export function registerInspectorEvents(inspector: InspectorEvents) {
|
export function registerInspectorEvents(inspector: InspectorEvents) {
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import * as inspectorCommandTypes from './InspectorBackendCommands.ios';
|
import * as inspectorCommandTypes from './InspectorBackendCommands.ios';
|
||||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
||||||
const inspectorCommands: typeof inspectorCommandTypes = require('./InspectorBackendCommands');
|
const inspectorCommands: typeof inspectorCommandTypes = require('./InspectorBackendCommands');
|
||||||
|
|
||||||
import * as debuggerDomains from '.';
|
import * as debuggerDomains from '.';
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import * as inspectorCommandTypes from './InspectorBackendCommands.ios';
|
import * as inspectorCommandTypes from './InspectorBackendCommands.ios';
|
||||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
||||||
const inspectorCommands: typeof inspectorCommandTypes = require('./InspectorBackendCommands');
|
const inspectorCommands: typeof inspectorCommandTypes = require('./InspectorBackendCommands');
|
||||||
|
|
||||||
import * as debuggerDomains from '.';
|
import * as debuggerDomains from '.';
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import * as inspectorCommandTypes from './InspectorBackendCommands.ios';
|
import * as inspectorCommandTypes from './InspectorBackendCommands.ios';
|
||||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
||||||
const inspectorCommands: typeof inspectorCommandTypes = require('./InspectorBackendCommands');
|
const inspectorCommands: typeof inspectorCommandTypes = require('./InspectorBackendCommands');
|
||||||
|
|
||||||
import * as debuggerDomains from '.';
|
import * as debuggerDomains from '.';
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import * as tslibType from 'tslib';
|
import * as tslibType from 'tslib';
|
||||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
||||||
const tslib: typeof tslibType = require('tslib');
|
const tslib: typeof tslibType = require('tslib');
|
||||||
import { Observable } from '../data/observable';
|
import { Observable } from '../data/observable';
|
||||||
import { trace as profilingTrace, time, uptime, level as profilingLevel } from '../profiling';
|
import { trace as profilingTrace, time, uptime, level as profilingLevel } from '../profiling';
|
||||||
|
@ -160,7 +160,6 @@ export function enable(mode: InstrumentationMode = 'counters') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
||||||
const appConfig = require('~/package.json');
|
const appConfig = require('~/package.json');
|
||||||
if (appConfig && appConfig.profiling) {
|
if (appConfig && appConfig.profiling) {
|
||||||
enable(appConfig.profiling);
|
enable(appConfig.profiling);
|
||||||
|
@ -95,7 +95,6 @@ const createComponentInstance = profile('createComponentInstance', (elementName:
|
|||||||
// Create instance of the component.
|
// Create instance of the component.
|
||||||
instance = new instanceType();
|
instance = new instanceType();
|
||||||
} catch (ex) {
|
} catch (ex) {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
||||||
const debug: typeof debugModule = require('../../../utils/debug');
|
const debug: typeof debugModule = require('../../../utils/debug');
|
||||||
throw new debug.ScopeError(ex, "Module '" + (resolvedModuleName || elementName) + "' not found for element '" + (namespace ? namespace + ':' : '') + elementName + "'.");
|
throw new debug.ScopeError(ex, "Module '" + (resolvedModuleName || elementName) + "' not found for element '" + (namespace ? namespace + ':' : '') + elementName + "'.");
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,6 @@ import { escapeRegexSymbols } from '../../../utils';
|
|||||||
import { Trace } from '../../../trace';
|
import { Trace } from '../../../trace';
|
||||||
import * as types from '../../../utils/types';
|
import * as types from '../../../utils/types';
|
||||||
import * as bindableResources from './bindable-resources';
|
import * as bindableResources from './bindable-resources';
|
||||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
||||||
const polymerExpressions = require('../../../js-libs/polymer-expressions');
|
const polymerExpressions = require('../../../js-libs/polymer-expressions');
|
||||||
import { PolymerExpressions } from '../../../js-libs/polymer-expressions';
|
import { PolymerExpressions } from '../../../js-libs/polymer-expressions';
|
||||||
|
|
||||||
|
@ -67,4 +67,4 @@ export const iosPreferredDatePickerStyleProperty = new Property<DatePickerBase,
|
|||||||
defaultValue: 0,
|
defaultValue: 0,
|
||||||
valueConverter: (v) => parseInt(v),
|
valueConverter: (v) => parseInt(v),
|
||||||
});
|
});
|
||||||
iosPreferredDatePickerStyleProperty.register(DatePickerBase);
|
iosPreferredDatePickerStyleProperty.register(DatePickerBase);
|
||||||
|
@ -268,7 +268,6 @@ let textField: View;
|
|||||||
|
|
||||||
export function getButtonColors(): { color: Color; backgroundColor: Color } {
|
export function getButtonColors(): { color: Color; backgroundColor: Color } {
|
||||||
if (!button) {
|
if (!button) {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
||||||
const Button = require('../button').Button;
|
const Button = require('../button').Button;
|
||||||
button = new Button();
|
button = new Button();
|
||||||
if (global.isIOS) {
|
if (global.isIOS) {
|
||||||
@ -288,7 +287,6 @@ export function getButtonColors(): { color: Color; backgroundColor: Color } {
|
|||||||
|
|
||||||
export function getLabelColor(): Color {
|
export function getLabelColor(): Color {
|
||||||
if (!label) {
|
if (!label) {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
||||||
const Label = require('../label').Label;
|
const Label = require('../label').Label;
|
||||||
label = new Label();
|
label = new Label();
|
||||||
if (global.isIOS) {
|
if (global.isIOS) {
|
||||||
@ -306,7 +304,6 @@ export function getLabelColor(): Color {
|
|||||||
|
|
||||||
export function getTextFieldColor(): Color {
|
export function getTextFieldColor(): Color {
|
||||||
if (!textField) {
|
if (!textField) {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
||||||
const TextField = require('../text-field').TextField;
|
const TextField = require('../text-field').TextField;
|
||||||
textField = new TextField();
|
textField = new TextField();
|
||||||
if (global.isIOS) {
|
if (global.isIOS) {
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
import '../../globals';
|
import '../../globals';
|
||||||
import { setActivityCallbacks, AndroidActivityCallbacks } from '.';
|
import { setActivityCallbacks, AndroidActivityCallbacks } from '.';
|
||||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
||||||
const appModule = require('../../application');
|
const appModule = require('../../application');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -289,7 +289,6 @@ export class FrameBase extends CustomLayoutView {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private isNestedWithin(parentFrameCandidate: FrameBase): boolean {
|
private isNestedWithin(parentFrameCandidate: FrameBase): boolean {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
||||||
let frameAncestor: FrameBase = this;
|
let frameAncestor: FrameBase = this;
|
||||||
while (frameAncestor) {
|
while (frameAncestor) {
|
||||||
frameAncestor = <FrameBase>getAncestor(frameAncestor, FrameBase);
|
frameAncestor = <FrameBase>getAncestor(frameAncestor, FrameBase);
|
||||||
|
@ -39,7 +39,6 @@ let fragmentId = -1;
|
|||||||
export let moduleLoaded: boolean;
|
export let moduleLoaded: boolean;
|
||||||
|
|
||||||
if (global && global.__inspector) {
|
if (global && global.__inspector) {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
||||||
const devtools = require('../../debugger/devtools-elements');
|
const devtools = require('../../debugger/devtools-elements');
|
||||||
devtools.attachDOMInspectorEventCallbacks(global.__inspector);
|
devtools.attachDOMInspectorEventCallbacks(global.__inspector);
|
||||||
devtools.attachDOMInspectorCommandCallbacks(global.__inspector);
|
devtools.attachDOMInspectorCommandCallbacks(global.__inspector);
|
||||||
|
@ -33,7 +33,6 @@ function ensureCssAnimationParserModule() {
|
|||||||
|
|
||||||
let parser: 'rework' | 'nativescript' | 'css-tree' = 'css-tree';
|
let parser: 'rework' | 'nativescript' | 'css-tree' = 'css-tree';
|
||||||
try {
|
try {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
||||||
const appConfig = require('~/package.json');
|
const appConfig = require('~/package.json');
|
||||||
if (appConfig) {
|
if (appConfig) {
|
||||||
if (appConfig.cssParser === 'rework') {
|
if (appConfig.cssParser === 'rework') {
|
||||||
|
2
packages/core/ui/time-picker/index.d.ts
vendored
2
packages/core/ui/time-picker/index.d.ts
vendored
@ -77,4 +77,4 @@ export const minMinuteProperty: Property<TimePicker, number>;
|
|||||||
export const timeProperty: Property<TimePicker, Date>;
|
export const timeProperty: Property<TimePicker, Date>;
|
||||||
export const minuteIntervalProperty: Property<TimePicker, number>;
|
export const minuteIntervalProperty: Property<TimePicker, number>;
|
||||||
|
|
||||||
export const iosPreferredDatePickerStyleProperty: Property<TimePicker, number>;
|
export const iosPreferredDatePickerStyleProperty: Property<TimePicker, number>;
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
// https://github.com/NativeScript/nativescript-dev-webpack/issues/932
|
// https://github.com/NativeScript/nativescript-dev-webpack/issues/932
|
||||||
|
|
||||||
import * as definition from '.';
|
import * as definition from '.';
|
||||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
||||||
const easysax = require('../js-libs/easysax');
|
const easysax = require('../js-libs/easysax');
|
||||||
import { EasySAXParser } from '../js-libs/easysax';
|
import { EasySAXParser } from '../js-libs/easysax';
|
||||||
|
|
||||||
|
4
tsconfig.eslint.json
Normal file
4
tsconfig.eslint.json
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"extends": "./tsconfig.json",
|
||||||
|
"include": ["packages/**/*"]
|
||||||
|
}
|
Reference in New Issue
Block a user