更新Ionic以使用scss-linter

时间:2018-03-03 11:05:50

标签: ionic-framework ionic3 scss-lint

我在一年前创建了一个Ionic3项目。我如何使用SCSS linter?

这是我的package.json

{
  "name": "xxx",
  "author": "xxx",
  "homepage": "xxx",
  "private": true,
  "scripts": {
    "clean": "ionic-app-scripts clean",
    "build": "ionic-app-scripts build",
    "lint": "ionic-app-scripts lint --bailOnLintError true",
    "ionic:build": "ionic-app-scripts build",
    "ionic:serve": "ionic-app-scripts serve",
    "test": "ng test"
  },
  "husky": {
    "hooks": {
      "pre-commit": "npm run lint"
    }
  },
  "dependencies": {
    "@angular/animations": "5.1.0",
    "@angular/common": "5.1.0",
    "@angular/compiler": "5.1.0",
    "@angular/compiler-cli": "5.1.0",
    "@angular/core": "5.1.0",
    "@angular/forms": "5.1.0",
    "@angular/http": "5.1.0",
    "@angular/platform-browser": "5.1.0",
    "@angular/platform-browser-dynamic": "5.1.0",
    "@angular/platform-server": "5.1.0",
    "@firebase/webchannel-wrapper": "^0.2.5",
    "@ionic-native/badge": "4.3.3",
    "@ionic-native/camera": "4.3.3",
    "@ionic-native/core": "4.3.3",
    "@ionic-native/deeplinks": "4.3.3",
    "@ionic-native/geolocation": "4.3.3",
    "@ionic-native/google-analytics": "4.3.3",
    "@ionic-native/launch-navigator": "4.3.3",
    "@ionic-native/network": "4.3.3",
    "@ionic-native/push": "4.3.3",
    "@ionic-native/splash-screen": "4.3.3",
    "@ionic-native/status-bar": "4.3.3",
    "@types/googlemaps": "3.26.20",
    "angular2-moment": "^1.7.0",
    "angularfire2": "^5.0.0-rc.5-next",
    "cordova-ios": "^4.5.4",
    "cordova-plugin-actionsheet": "^2.3.3",
    "cordova-plugin-badge": "^0.8.5",
    "cordova-plugin-camera": "^3.0.0",
    "cordova-plugin-compat": "^1.2.0",
    "cordova-plugin-console": "^1.1.0",
    "cordova-plugin-device": "^1.1.7",
    "cordova-plugin-dialogs": "^1.3.4",
    "cordova-plugin-geolocation": "^2.4.3",
    "cordova-plugin-google-analytics": "^1.8.3",
    "cordova-plugin-ionic-webview": "^1.1.16",
    "cordova-plugin-network-information": "^1.3.4",
    "cordova-plugin-splashscreen": "^4.1.0",
    "cordova-plugin-statusbar": "^2.3.0",
    "cordova-plugin-whitelist": "^1.3.3",
    "cordova-sqlite-storage": "^2.1.2",
    "firebase": "^4.8.0",
    "ionic-angular": "^3.9.2",
    "ionic-plugin-deeplinks": "^1.0.15",
    "ionicons": "3.0.0",
    "promise-polyfill": "6.0.2",
    "rxjs": "^5.5.5",
    "sw-toolbox": "3.6.0",
    "uk.co.workingedge.phonegap.plugin.launchnavigator": "^4.1.0",
    "zone.js": "^0.8.18"
  },
  "devDependencies": {
    "@angular/cli": "1.6.8",
    "@ionic/app-scripts": "^3.1.8",
    "@types/jasmine": "^2.8.2",
    "@types/node": "^7.0.48",
    "codecov": "^2.3.1",
    "husky": "^0.15.0-rc.7",
    "ionic": "3.19.1",
    "jasmine-core": "^2.8.0",
    "jasmine-spec-reporter": "^4.2.1",
    "karma": "^1.7.1",
    "karma-chrome-launcher": "^2.2.0",
    "karma-jasmine": "^1.1.1",
    "karma-mocha-reporter": "^2.2.5",
    "karma-remap-istanbul": "^0.6.0",
    "ts-node": "^3.3.0",
    "tslint": "^5.9.1",
    "tslint-eslint-rules": "^4.0.0",
    "typescript": "2.4.2"
  },
  "cordovaPlugins": [
    "cordova-plugin-device",
    "cordova-plugin-console",
    "cordova-plugin-whitelist",
    "cordova-plugin-splashscreen",
    "cordova-plugin-statusbar",
    "cordova-plugin-network-information",
    "ionic-plugin-keyboard"
  ],
  "cordovaPlatforms": [
    "ios",
    {
      "platform": "ios",
      "version": "",
      "locator": "ios"
    }
  ],
  "description": "xxx",
  "cordova": {
    "platforms": [
      "ios"
    ],
    "plugins": {
      "cordova-plugin-console": {},
      "cordova-plugin-device": {},
      "cordova-plugin-geolocation": {
        "GEOLOCATION_USAGE_DESCRIPTION": " "
      },
      "cordova-plugin-network-information": {},
      "cordova-plugin-whitelist": {},
      "cordova-sqlite-storage": {},
      "ionic-plugin-deeplinks": {
        "URL_SCHEME": "xxx",
        "DEEPLINK_SCHEME": "https",
        "DEEPLINK_HOST": "xxx",
        "ANDROID_PATH_PREFIX": "/",
        "ANDROID_2_PATH_PREFIX": "/",
        "ANDROID_3_PATH_PREFIX": "/",
        "ANDROID_4_PATH_PREFIX": "/",
        "ANDROID_5_PATH_PREFIX": "/",
        "DEEPLINK_2_SCHEME": " ",
        "DEEPLINK_2_HOST": " ",
        "DEEPLINK_3_SCHEME": " ",
        "DEEPLINK_3_HOST": " ",
        "DEEPLINK_4_SCHEME": " ",
        "DEEPLINK_4_HOST": " ",
        "DEEPLINK_5_SCHEME": " ",
        "DEEPLINK_5_HOST": " "
      },
      "cordova-plugin-google-analytics": {},
      "uk.co.workingedge.phonegap.plugin.launchnavigator": {
        "LOCATION_USAGE_DESCRIPTION": "This app requires access to your location for navigation purposes"
      },
      "cordova-plugin-ionic-webview": {},
      "cordova-plugin-camera": {},
      "cordova-plugin-splashscreen": {},
      "cordova-plugin-badge": {},
      "cordova-plugin-statusbar": {}
    }
  }
}

1 个答案:

答案 0 :(得分:0)

您应该安装:npm i tslint-ionic-rules --save-dev 而在你的tslint.json文件中添加:

{
  "extends": "tslint-ionic-rules"
}