Giter VIP home page Giter VIP logo

Comments (6)

lydell avatar lydell commented on May 17, 2024

Hi! I've never used eslint-plugin-markdown before. Can you show me how you set things up? The best thing would be a small reproduction repo.

from eslint-plugin-simple-import-sort.

heygrady avatar heygrady commented on May 17, 2024
module.exports = {
  extends: [],
  plugins: [
    'simple-import-sort',
    'markdown',
  ],
  rules: {
    'simple-import-sort/sort': 'error',
  },
  overrides: [
    {
      files: ['**/*.md'],
      parserOptions: {
        ecmaFeatures: {
          impliedStrict: true,
        },
      },
      rules: {
        'simple-import-sort/sort': 'error',
      },
    },
  ],
}
Some text

\\```js
import b from 'b'
import a from 'a'
\\```

from eslint-plugin-simple-import-sort.

lydell avatar lydell commented on May 17, 2024

Couldn’t you have bothered to post something that actually works? 😢

Anyway, after fighting ESLint’s configuration for a while I finally made it work and could reproduce the issue. But now I lost my steam for working on the bug.

Some text

```js
import b from 'b'
import a from 'a'
```

is autofixed to:

import a from 'a'
import b from 'b'
```

In other words, everything before the first import seems to be removed.

from eslint-plugin-simple-import-sort.

lydell avatar lydell commented on May 17, 2024

Discovery: The issue only seems to occur when the autofix applies from the very beginning of the code block (index 0).

For example:

Some text

```js
;import b from 'b'
import a from 'a'
```

successfully autofixes to:

Some text

```js
;import a from 'a'
import b from 'b'
```

Feels like a bug in eslint-plugin-markdown. I need to investigate further.

from eslint-plugin-simple-import-sort.

lydell avatar lydell commented on May 17, 2024

eslint/eslint-plugin-markdown#119 has been merged, so the next version of eslint-plugin-markdown should not cause removals of markdown above imports anymore.

You might still run into eslint/eslint-plugin-markdown#120, though.

from eslint-plugin-simple-import-sort.

lydell avatar lydell commented on May 17, 2024

v1.0.1 of eslint-plugin-markdown has been released! All the above issues should be fixed.

I have some uncommitted test that I need to finish up, then we can close this issue.

from eslint-plugin-simple-import-sort.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.