2016-12-02 27 views
13

मैं 4.0.2 करने के लिए अपने tslint उन्नत बनाया है और अब मैं निम्नलिखितअद्यतन TSLint त्रुटियाँ: विन्यास

Could not find implementations for the following rules specified in the configuration: 
    directive-selector-name 
    component-selector-name 
    directive-selector-type 
    component-selector-type 
    directive-selector-prefix 
    component-selector-prefix 
    label-undefined 
    no-constructor-vars 
    no-duplicate-key 
    no-unreachable 
    use-strict 

तरह त्रुटियों की एक बहुत कुछ मिल में निर्दिष्ट निम्नलिखित नियम मेरा मानना ​​है कि इस मुद्दे को हो सकता है के लिए कार्यान्वयन नहीं मिल सका हो सकता है कि मेरा tslint.json पुराना हो और मुझे इसे अपडेट करने की आवश्यकता हो, लेकिन मुझे यह नहीं पता कि यह कैसे करना है या यहां तक ​​कि अगर मेरी धारणा सही है।

tslint.json

{ 
    "rulesDirectory": [ 
    "node_modules/codelyzer" 
    ], 
    "rules": { 
    "directive-selector-name": [true, "camelCase"], 
    "component-selector-name": [true, "kebab-case"], 
    "directive-selector-type": [true, "attribute"], 
    "component-selector-type": [true, "element"], 
    "directive-selector-prefix": [true, "my"], 
    "component-selector-prefix": [true, "my"], 
    "use-input-property-decorator": true, 
    "use-output-property-decorator": true, 
    "use-host-property-decorator": true, 
    "no-attribute-parameter-decorator": true, 
    "no-input-rename": true, 
    "no-output-rename": true, 
    "no-forward-ref" :true, 
    "use-life-cycle-interface": true, 
    "use-pipe-transform-interface": true, 
    "pipe-naming": [true, "camelCase", "my"], 
    "component-class-suffix": true, 
    "directive-class-suffix": true, 
    "ban": [true, 
     ["_", "extend"], 
     ["_", "isNull"], 
     ["_", "isDefined"] 
    ], 
    "class-name": true, 
    "comment-format": [false, 
     "check-space", 
     "check-lowercase" 
    ], 
    "curly": true, 
    "eofline": true, 
    "forin": true, 
    "indent": [true, 2], 
    "interface-name": true, 
    "jsdoc-format": true, 
    "label-position": true, 
    "label-undefined": true, 
    "max-line-length": [false, 140], 
    "member-ordering": [true, 
     "public-before-private", 
     "static-before-instance", 
     "variables-before-functions" 
    ], 
    "no-arg": true, 
    "no-bitwise": true, 
    "no-console": [true, 
     "debug", 
     "info", 
     "time", 
     "timeEnd", 
     "trace" 
    ], 
    "no-construct": true, 
    "no-constructor-vars": false, 
    "no-debugger": true, 
    "no-duplicate-key": true, 
    "no-duplicate-variable": true, 
    "no-empty": true, 
    "no-eval": true, 
    "no-string-literal": true, 
    "no-switch-case-fall-through": true, 
    "trailing-comma": true, 
    "no-trailing-whitespace": true, 
    "no-unused-expression": true, 
    "no-unused-variable": true, 
    "no-unreachable": true, 
    "no-use-before-declare": true, 
    "no-var-requires": true, 
    "one-line": [true, 
     "check-open-brace", 
     "check-catch", 
     "check-else", 
     "check-whitespace" 
    ], 
    "quotemark": [true, "single"], 
    "radix": true, 
    "semicolon": true, 
    "triple-equals": [true, "allow-null-check"], 
    "typedef": [true, 
     "callSignature", 
     "indexSignature", 
     "parameter", 
     "propertySignature", 
     "variableDeclarator" 
    ], 
    "typedef-whitespace": [true, 
     ["callSignature", "noSpace"], 
     ["catchClause", "noSpace"], 
     ["indexSignature", "space"] 
    ], 
    "use-strict": false, 
    "variable-name": false, 
    "whitespace": [true, 
     "check-branch", 
     "check-decl", 
     "check-operator", 
     "check-separator", 
     "check-type" 
    ] 
    } 
} 

packages.json

{ 
    "dependencies": { 
    "@angular/common": "^2.2.4", 
    "@angular/compiler": "^2.2.4", 
    "@angular/core": "^2.2.4", 
    "@angular/forms": "^2.2.4", 
    "@angular/http": "^2.2.4", 
    "@angular/platform-browser": "^2.2.4", 
    "@angular/platform-browser-dynamic": "^2.2.4", 
    "@angular/router": "^3.2.4", 
    "@ng-bootstrap/ng-bootstrap": "^1.0.0-alpha.14", 
    "ag-grid": "^7.0.0", 
    "angularfire2": "^2.0.0-beta.5", 
    "core-js": "^2.4.1", 
    "firebase": "^3.6.2", 
    "rxjs": "5.0.0-rc.4", 
    "zone.js": "^0.7.2" 
    }, 
    "devDependencies": { 
    "del": "^2.0.2", 
    "gulp": "gulpjs/gulp#4ed9a4a3275559c73a396eff7e1fde3824951ebb", 
    "gulp-hub": "frankwallis/gulp-hub#d461b9c700df9010d0a8694e4af1fb96d9f38bf4", 
    "gulp-filter": "^4.0.0", 
    "gulp-util": "^3.0.7", 
    "gulp-sass": "^2.1.1", 
    "browser-sync": "^2.18.2", 
    "browser-sync-spa": "^1.0.3", 
    "karma": "^1.3.0", 
    "karma-coverage": "^1.1.1", 
    "karma-jasmine": "^1.0.2", 
    "karma-junit-reporter": "^1.1.0", 
    "jasmine": "^2.4.1", 
    "es6-shim": "^0.35.0", 
    "karma-chrome-launcher": "^2.0.0", 
    "babel-plugin-istanbul": "^3.0.0", 
    "karma-webpack": "^1.7.0", 
    "webpack": "2.1.0-beta.20", 
    "html-webpack-plugin": "^2.24.1", 
    "style-loader": "^0.13.0", 
    "css-loader": "^0.26.0", 
    "postcss-loader": "^1.1.1", 
    "autoprefixer": "^6.5.3", 
    "json-loader": "^0.5.4", 
    "extract-text-webpack-plugin": "^2.0.0-beta.3", 
    "html-loader": "^0.4.3", 
    "ts-loader": "^1.2.2", 
    "sass-loader": "^4.0.2", 
    "node-sass": "^3.13.0", 
    "eslint": "^3.11.1", 
    "eslint-config-xo-space": "^0.15.0", 
    "eslint-loader": "^1.6.1", 
    "babel-loader": "^6.2.8", 
    "babel-eslint": "^7.1.1", 
    "eslint-plugin-babel": "^4.0.0", 
    "tslint": "^4.0.2", 
    "typescript": "^2.0.10", 
    "typings": "^2.0.0", 
    "tslint-loader": "^3.2.1", 
    "codelyzer": "^2.0.0-beta.1" 
    }, 
    "scripts": { 
    "build": "gulp", 
    "serve": "gulp serve", 
    "serve:dist": "gulp serve:dist", 
    "test": "gulp test", 
    "test:auto": "gulp test:auto" 
    }, 
    "eslintConfig": { 
    "root": true, 
    "env": { 
     "browser": true, 
     "jasmine": true 
    }, 
    "extends": [ 
     "xo-space/esnext" 
    ] 
    } 
} 

उत्तर

33

मैं एक ही नाव में था। मुझे नहीं पता कि आपकी पिछली संस्करण tslint क्या थी, लेकिन, मेरे लिए, मैंने 3.15.1 से 4.0.2 तक अपग्रेड किया और मेरा परिणामस्वरूप "टूटा नियम" सूची आपके से अलग है। फिर भी, मैं आपको उन लोगों के लिए कुछ फिक्स/स्पष्टीकरण प्रदान कर सकता हूं जो आपके और मेरे समान थे।

मैं बस tslint's changelog on GitHub पर गया, पाया गया नियम मिला, लाइन के अंत में समस्या संख्या मिली, & इस मुद्दे को देखा। नेविगेट करने का सबसे आसान तरीका था समस्या संख्या को उनके गिटहब समस्या यूआरएल के अंत में जोड़ना था। उदाहरण के लिए, label-undefined था http // github.com/Palantir/tslint/मुद्दों/877

यहाँ लोगों को मैं

  • लेबल अपरिभाषित यह पता लगाने के लिए था है -> टाइपप्रति संकलक अब इस संभालती है, इसलिए tslint.json से "label-undefined": true हटा दें और अपना tsconfig.json की compilerOptions अनुभाग के लिए "allowUnusedLabels": false जोड़ने
  • कोई निर्माता-वार्स -> नियम का नाम बदला है, तो आपके tslint.json में "no-parameter-properties" को "no-constructor-vars" बदलने
  • 012,
  • नो-डुप्लिकेट-कुंजी ->"no-duplicate-key": true हटाएं पूरी तरह से बी/सी टाइपस्क्रिप्ट अब इसे संभालता है (डुप्लिकेट अगर संकलित नहीं होगा)।
  • कोई नहीं पहुंचा जा सकता ->"use-strict" नियम पूरी तरह निकाल दें -> टाइपप्रति संकलक
  • उपयोग-सख्त यह अब है, तो tslint.json से "no-unreachable": true हटा दें और अपना tsconfig.json की compilerOptions अनुभाग के लिए "noImplicitReturns": true जोड़ने हैंडल बी/सी टाइपस्क्रिप्ट अब सभी मॉड्यूल निकायों को सख्त मोड में पार्स करता है।
+0

अभी भी उपयोगी समाधान और बहुत अच्छी तरह से समझाया गया है! –

2

tslint v4 कि अब कोई मतलब नहीं बनाया है और टाइपप्रति जाँच बेहतर हो गया है नियमों का एक गुच्छा निकाला गया। यदि आप अभी भी उन नियमों का उपयोग करना चाहते हैं तो आपको tslint v3 का उपयोग करने की आवश्यकता है।

+0

मदद के लिए धन्यवाद Basarat –

4

कोडोडर 2.0.0-बीटा 1 के रूप में कुछ तोड़ने वाले बदलाव हैं। उन्होंने निर्देश-चयनकर्ता-नाम, घटक-चयनकर्ता-नाम, निर्देश-चयनकर्ता-प्रकार, घटक-चयनकर्ता-प्रकार, निर्देश-चयनकर्ता-उपसर्ग और घटक-चयनकर्ता-उपसर्ग को अब समर्थित नहीं किया है।इसके बजाय, वे नीचे दिए गए नियम कहा:

"directive-selector": [true, "attribute", "app", "camelCase"], 
"component-selector": [true, "element", "app", "kebab-case"], 

कृपया codelyzer के लिए changelog को देखने के लिए और किसी भी नियम है कि

0

समर्थित नहीं है मैं Could not find implementations for the following rules... चेतावनी मेरी आईडीई में दिखाने के साथ इस एक ही मुद्दा था के लिए खोज, WebStorm 2016.x. मेरे मामले में, नियम कार्यान्वयन आईडीई द्वारा प्रदान किए गए थे, क्योंकि मेरे वेबस्टॉर्म को अपग्रेड करने से समस्या ठीक हुई।

मैंने टाइपस्क्रिप्ट, टीएसलिंट & कोडेलीज़र को अपग्रेड करने के लिए अपग्रेड किया। मैंने अपनी tslint.json फ़ाइल की सामग्री का निरीक्षण किया और कुछ भी नहीं मिला। वेबस्टॉर्म को अपग्रेड करने से समस्या ठीक हुई।

0

मुझे एक कोणीय परियोजना से नियमों की प्रतिलिपि बनाने के बाद भी यही समस्या थी। बस एक नया खाली टाइपस्क्रिप्ट प्रोजेक्ट बनाएं और आप ठीक होंगे।

संबंधित मुद्दे