-
-
Notifications
You must be signed in to change notification settings - Fork 209
Please use export @dec class
instead
#662
Comments
bump, any changes? |
You can use the old decorators proposal: {
parserOptions: {
ecmaFeatures: {
legacyDecorators: true
}
}
} |
@nicolo-ribaudo this does not seem to do anything. Here is my babel config. {
"extends": ["airbnb", "prettier"],
"parser": "babel-eslint",
"globals": {
"window": true
},
"rules": {
"arrow-body-style": "off",
"class-methods-use-this": "off",
"default-case": "off",
"import/no-dynamic-require": "off",
"import/no-extraneous-dependencies": "off",
"import/no-named-as-default": "off",
"import/no-named-as-default-member": "off",
"no-param-reassign": "off",
"no-plusplus": "off",
"no-return-assign": "off",
"no-shadow": "off",
"no-underscore-dangle": "off",
"no-use-before-define": "off",
"react/destructuring-assignment": "off",
"react/forbid-prop-types": "off",
"react/jsx-filename-extension": "off",
"react/jsx-one-expression-per-line": "off",
"react/no-this-in-sfc": "off",
"react/prefer-stateless-function": "off",
"yoda": "off",
"no-unused-vars": [
"warn",
{
"args": "after-used",
"argsIgnorePattern": "^_",
"ignoreRestSiblings": true,
"vars": "all"
}
],
"comma-dangle": ["error", "never"],
"import/extensions": ["error", "ignorePackages"],
"import/no-unresolved": [
"error",
{
"ignore": [
"./stories$",
"/storiesOf",
"^native-base",
"^react-native",
"^reaction-base",
"^reation-build",
"^~"
]
}
]
},
"parserOptions": {
"ecmaFeatures": {
"legacyDecotators": true
}
}
} |
@codejamninja You have a typo: |
Oh my, it's super embarrassing when your GitHub issue is just a typo for the whole world to see. 🥇 |
That fixed it 👍 |
@nicolo-ribaudo I wonder where should i add the statement? |
It goes in your |
@codejamninja THANKS,I didn't use eslint before.However,after I installed it and add .eslintrc file.The error is still happening.....(sad) |
@Zhxhh your lint file declares
|
@Zhxhh can you please use code blocks. It makes it super hard to read your comment. |
@Zhxhh maybe you should add the babel-eslint parser .eslintrc
|
Has anyone here a reference to how the new decorators syntax should be used? Wasn't able to google how one should change something like import { Foo } from 'bar'
@connect(
state => …
)
export default class SomeClass extends SomeOtherClass {
…
} |
@Mati365 RN 0.57 throws |
you can edit .eslintrc and add my .eslintrc file is } this can fix this problem |
It seems that you cannot use connect and export default together. They should be used separated: import { Foo } from 'bar'
@connect(
state => …
)
class SomeClass extends SomeOtherClass {
…
}
export default SomeClass; |
This is confusing to me. The suggestion of using The reason for that is that I was under the impression that babel-eslint uses babel to apply rules in eslint. In babel, I have configured:
Should eslint pick that up when using babel-eslint? Or am I missing the point? (I'm think it might be the latter). |
Only with |
Aaaaaah.... That makes sense. I'll give that a go then :) Thanks! |
I think this issue can be closed then, if you have a different issue please create a new one? thanks! |
I'm facing the issue module.exports = { and .babelrc file : } |
you got a wrong word: legacyDecorators |
This worked for me
|
When this thing is written |
I am getting this error using 8.2.2
Using the export keyword between a decorator and a class is not allowed. Please use
export @dec class
insteadswitching back to 8.0.0 the error goes away ...
The text was updated successfully, but these errors were encountered: