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 from 2.7.0 #32

Closed
frederikhors opened this issue Jul 12, 2019 · 7 comments
Closed

Problems from 2.7.0 #32

frederikhors opened this issue Jul 12, 2019 · 7 comments
Labels
bug Something isn't working

Comments

@frederikhors
Copy link
Contributor

From "eslint-plugin-svelte3": "2.7.0", both my IDE with eslint support and npx eslint src/** from cli complains about:

3:3 error Import in body of module; reorder to top import/first

which is disable like this in .eslintrc.js:

module.exports = {
  root: true,
  parserOptions: {
    ecmaVersion: 2019,
    sourceType: 'module'
  },
  env: {
    es6: true,
    browser: true,
    node: true
  },
  extends: [
    'eslint:recommended',
    'standard'
  ],
  plugins: ['svelte3'],
  overrides: [
    {
      files: ['*.svelte'],
      processor: 'svelte3/svelte3',
      rules: {
        'import/first': 0,
        'import/no-duplicates': 0,
        'import/no-mutable-exports': 0
      }
    }
  ]
}

With 2.6.0 everything ok.

Why?

@Conduitry
Copy link
Member

Conduitry commented Jul 12, 2019

Sorry about that! I suppose the addition of named code blocks was sort of a breaking change. You need to disable the rules on '**/*.svelte/*.js' now. I'll explain this better in the docs soon.

@Conduitry
Copy link
Member

Actually, I think I'll release a bugfix version that puts the named code blocks feature behind a setting so you have to explicitly opt in. I really wasn't thinking about how much of a breaking change this would be.

@Conduitry Conduitry added the bug Something isn't working label Jul 12, 2019
@Conduitry
Copy link
Member

2.7.1 has been released. Does this fix the errors for you?

@frederikhors
Copy link
Contributor Author

2.7.1 has been released. Does this fix the errors for you?

yep.

@nickelghost
Copy link

nickelghost commented Jan 22, 2020

I have the same issue, but only with some files.
Screenshot from 2020-01-22 07-13-14
2:1 error Import in body of module; reorder to top import/first

@mckravchyk
Copy link

@nickelghost It seems like it does not work if you are using a $: declaration. It also does not work when there are multiple script tags and importing something that is not in the first script tag.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants