Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems with selectors (eslint 3.18.0) #454

Closed
albertosantini opened this issue Mar 18, 2017 · 2 comments
Closed

Problems with selectors (eslint 3.18.0) #454

albertosantini opened this issue Mar 18, 2017 · 2 comments
Assignees
Labels
Milestone

Comments

@albertosantini
Copy link

albertosantini commented Mar 18, 2017

Updating eslint from 3.17.1 to 3.18.0 I get the following error:

$ node_modules/.bin/eslint src/client/app/root.module.js
Syntax error in selector "angular:animation" at position 8: Expected "declaration", "expression", "function", "pattern" or "statement" but "a" found.
Error: Syntax error in selector "angular:animation" at position 8: Expected "declaration", "expression", "function", "pattern" or "statement" but "a" found.
    at tryParseSelector (C:\My\Dev\argo-trading\argo\node_modules\eslint\lib\util\node-event-generator.js:163:19)
    at lodash.memoize.rawSelector (C:\My\Dev\argo-trading\argo\node_modules\eslint\lib\util\node-event-generator.js:175:28)
    at memoized (C:\My\Dev\argo-trading\argo\node_modules\lodash\lodash.js:10566:27)
    at NodeEventGenerator.eventNames.forEach.rawSelector (C:\My\Dev\argo-trading\argo\node_modules\eslint\lib\util\node-event-generator.js:235:30)
    at Array.forEach (native)
    at new NodeEventGenerator (C:\My\Dev\argo-trading\argo\node_modules\eslint\lib\util\node-event-generator.js:234:20)
    at EventEmitter.module.exports.api.verify (C:\My\Dev\argo-trading\argo\node_modules\eslint\lib\eslint.js:914:34)
    at processText (C:\My\Dev\argo-trading\argo\node_modules\eslint\lib\cli-engine.js:264:31)
    at processFile (C:\My\Dev\argo-trading\argo\node_modules\eslint\lib\cli-engine.js:303:18)
    at executeOnFile (C:\My\Dev\argo-trading\argo\node_modules\eslint\lib\cli-engine.js:672:25)

It seems 3.18.0 introduce AST selectors.
I open the issue here, because, without the plugin, that message is not displayed.

The input file root.module.js:

import angular from "angular";

import { rootComponent } from "./root.component";
import { common } from "./common/common.module";
import { components } from "./components/components.module";

export const root = angular
    .module("root", [
        common,
        components
    ])
    .component("root", rootComponent)
    .name;

.eslintrc.yml

root: true

parserOptions:
    ecmaVersion: 8
    sourceType: "module"

env:
    es6: true
    node: true

plugins:
    - angular

extends:
    "eslint:recommended"

rules:
    array-bracket-spacing: "error"
    array-callback-return: "error"
    arrow-body-style: ["error", "as-needed"]
    arrow-parens: ["error", "as-needed"]
    arrow-spacing: "error"
    indent: ["error", 4, {SwitchCase: 1}]
    block-spacing: "error"
    brace-style: ["error", "1tbs"]
    camelcase: ["error", { properties: "never" }]
    callback-return: ["error", ["cb", "callback", "next"]]
    class-methods-use-this: "error"
    comma-dangle: "error"
    comma-spacing: "error"
    comma-style: ["error", "last"]
    consistent-return: "error"
    curly: ["error", "all"]
    default-case: "error"
    dot-notation: ["error", { allowKeywords: true }]
    eol-last: "error"
    eqeqeq: "error"
    func-call-spacing: "error"
    func-style: ["error", "declaration"]
    generator-star-spacing: "error"
    guard-for-in: "error"
    key-spacing: ["error", { beforeColon: false, afterColon: true }]
    keyword-spacing: "error"
    lines-around-comment: ["error", {
        beforeBlockComment: true,
        afterBlockComment: false,
        beforeLineComment: true,
        afterLineComment: false
    }]
    new-cap: "error"
    newline-after-var: "error"
    new-parens: "error"
    no-alert: "error"
    no-array-constructor: "error"
    no-caller: "error"
    no-confusing-arrow: "error"
    no-console: "error"
    no-delete-var: "error"
    no-else-return: "error"
    no-eval: "error"
    no-extend-native: "error"
    no-extra-bind: "error"
    no-fallthrough: "error"
    no-floating-decimal: "error"
    no-global-assign: "error"
    no-implied-eval: "error"
    no-invalid-this: "error"
    no-iterator: "error"
    no-label-var: "error"
    no-labels: "error"
    no-lone-blocks: "error"
    no-loop-func: "error"
    no-mixed-spaces-and-tabs: ["error", false]
    no-multi-spaces: "error"
    no-multi-str: "error"
    no-native-reassign: "off"
    no-nested-ternary: "error"
    no-new: "error"
    no-new-func: "error"
    no-new-object: "error"
    no-new-wrappers: "error"
    no-octal: "error"
    no-octal-escape: "error"
    no-process-exit: "error"
    no-proto: "error"
    no-redeclare: "error"
    no-return-assign: "error"
    no-script-url: "error"
    no-self-assign: "error"
    no-sequences: "error"
    no-shadow: "error"
    no-shadow-restricted-names: "error"
    no-tabs: "error"
    no-trailing-spaces: "error"
    no-undef: ["error", {typeof: true}]
    no-undef-init: "error"
    no-undefined: "error"
    no-underscore-dangle: ["error", {allowAfterThis: true}]
    no-unmodified-loop-condition: "error"
    no-unneeded-ternary: "error"
    no-unused-expressions: "error"
    no-unused-vars: ["error", {vars: "all", args: "after-used"}]
    # no-use-before-define: "error"
    no-use-before-define: ["error", "nofunc"]
    no-useless-computed-key: "error"
    no-useless-concat: "error"
    no-useless-constructor: "error"
    no-useless-escape: "error"
    no-useless-return: "error"
    no-with: "error"
    no-var: "error"
    object-curly-spacing: ["error", "always"]
    object-shorthand: "error"
    one-var-declaration-per-line: "error"
    operator-linebreak: "error"
    prefer-arrow-callback: "error"
    prefer-const: "error"
    prefer-promise-reject-errors: "error"
    prefer-template: "error"
    quotes: ["error", "double"]
    quote-props: ["error", "as-needed"]
    radix: "error"
    # require-jsdoc: "error"
    require-jsdoc: "off"
    semi: "error"
    semi-spacing: ["error", {before: false, after: true}]
    space-before-blocks: "error"
    space-before-function-paren: ["error", "never"]
    space-in-parens: "error"
    space-infix-ops: "error"
    space-unary-ops: ["error", {words: true, nonwords: false}]
    spaced-comment: ["error", "always", { exceptions: ["-"]}]
    strict: ["error", "global"]
    template-curly-spacing: ["error", "never"]
    template-tag-spacing: "error"
    valid-jsdoc: ["error", {
        prefer: { "return": "returns"},
        preferType: {
            "String": "string",
            "Number": "number",
            "Boolean": "boolean",
            "object": "Object",
            "function": "Function"
        }
    }]
    wrap-iife: "error"
    yield-star-spacing: "error"
    yoda: ["error", "never"]

    # Previously on by default in node environment
    no-catch-shadow: "off"
    no-mixed-requires: "error"
    no-new-require: "error"
    no-path-concat: "error"
    handle-callback-err: ["error", "err"]

    angular/angularelement: "warn"
    angular/controller-as: "error"
    angular/controller-as-route: "error"
    angular/controller-as-vm: ["error", "vm"]
    angular/controller-name: ["error", "/[A-Z].*Controller$/"]
    angular/deferred: "off"
    angular/definedundefined: "error"
    angular/di: ["error", "function"]
    angular/di-order: ["off", true]
    angular/directive-name: "off"
    angular/component-limit: ["off", 1]
    angular/document-service: "error"
    angular/empty-controller: "off"
    angular/file-name: "off"
    angular/filter-name: "off"
    angular/foreach: "off"
    angular/function-type: "off"
    angular/interval-service: "error"
    angular/json-functions: "error"
    angular/log: "error"
    angular/module-getter: "error"
    angular/module-name: "off"
    angular/module-setter: "error"
    angular/no-angular-mock: "off"
    angular/no-controller: "off"
    angular/no-cookiestore: "error"
    angular/no-jquery-angularelement: "error"
    angular/no-private-call: "error"
    angular/no-service-method: "off"
    angular/no-services: ["error", ["$http", "$resource", "Restangular"]]
    angular/on-watch: "error"
    angular/rest-service: "off"
    angular/service-name: "error"
    angular/timeout-service: "error"
    angular/typecheck-array: "error"
    angular/typecheck-date: "error"
    angular/typecheck-function: "error"
    angular/typecheck-number: "error"
    angular/typecheck-object: "error"
    angular/typecheck-string: "error"
    angular/watchers-execution: ["off", "$digest"]
    angular/window-service: "error"
@ghost
Copy link

ghost commented Mar 18, 2017

I ran into the same issue. I hope this will be fixed soon.

@albertosantini
Copy link
Author

Tested with 1.6.3. It is ok.

Thanks for the quick fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants