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

warning > can be escaped with > #287

Closed
chenxsan opened this issue Mar 17, 2021 · 0 comments · Fixed by #288
Closed

warning > can be escaped with > #287

chenxsan opened this issue Mar 17, 2021 · 0 comments · Fixed by #288
Labels
💪 phase/solved Post is done

Comments

@chenxsan
Copy link
Contributor

Subject of the issue

Here's the content of a mdx file:

Webpack 5 has been officially released. Read our <a href="/blog/2020-10-10-webpack-5-release/">announcement</a>. Not ready yet? Read <a href="https://v4.webpack.js.org/">webpack 4 documentation here</a>.

And the eslint configuration:

module.exports = {
  root: true,
  extends: ['eslint:recommended', 'plugin:react/recommended', 'prettier'],
  parser: '@babel/eslint-parser',
  env: {
    browser: true,
    es6: true,
    node: true,
    jest: true,
    'cypress/globals': true,
  },
  plugins: ['markdown', 'cypress', 'react-hooks'],
  globals: {
    __DEV__: true,
  },
  rules: {
    'no-console': 'off',
    semi: ['error', 'always'],
    quotes: ['error', 'single'],
    'react/jsx-uses-react': 'off', // no longer needed with new jsx transform
    'react/react-in-jsx-scope': 'off', // ditto
    'react-hooks/rules-of-hooks': 'error',
    'react-hooks/exhaustive-deps': 'warn',
  },
  settings: {
    react: {
      version: 'detect',
    },
  },
  overrides: [
    { files: ['src/**/*.jsx'] }, // eslint would lint .js only by default
    {
      files: ['**/*.mdx'],
      extends: ['plugin:mdx/recommended'],
      globals: {
        Badge: true,
      },
      rules: {
        semi: ['off'],
      },
      settings: {
        'mdx/code-blocks': true,
      },
    },
    {
      files: ['**/*.md'],
      processor: 'markdown/markdown',
    },
    {
      files: ['**/*.{md,mdx}/*.{js,javascript}'], // we don't lint ts at the moment
      rules: {
        indent: ['error', 2],
        quotes: ['error', 'single'],
        'no-undef': 'off',
        'no-unused-vars': 'off',
        'no-constant-condition': 'off',
        'no-useless-escape': 'off',
        'no-dupe-keys': 'off',
      },
    },
  ],
};

And here's the lint result:

  1:94   warning  `"` can be escaped with `&quot;`, `&ldquo;`, `&#34;`, `&rdquo;`  mdx/no-unescaped-entities
  1:95   warning  `>` can be escaped with `&gt;`                                   mdx/no-unescaped-entities
  1:111  warning  `>` can be escaped with `&gt;`                                   mdx/no-unescaped-entities

Your environment

  • OS:
  • Packages:
  • Env:

Steps to reproduce

Here's the pull request webpack/webpack.js.org#4326 you can use to reproduce:

  1. clone the pull request
  2. run yarn to install
  3. run yarn lint:js

Expected behaviour

No warning showed.

Actual behaviour

Warnings.

@chenxsan chenxsan added 🐛 type/bug This is a problem 🙉 open/needs-info This needs some more info labels Mar 17, 2021
JounQin added a commit that referenced this issue Mar 17, 2021
this causes issue with react/no-unescaped-entities\nso now mdx/no-unescaped-entities can be removed!

fix #287
JounQin added a commit that referenced this issue Mar 17, 2021
this causes issue with `react/no-unescaped-entities` before
so now `mdx/no-unescaped-entities` can be removed!

fix #287
JounQin added a commit that referenced this issue Mar 17, 2021
this causes issue with `react/no-unescaped-entities` before
so now `mdx/no-unescaped-entities` and `eslint-plugin-react` dep can be removed!

fix #287
JounQin added a commit that referenced this issue Mar 17, 2021
* feat: fix incorrect node loc

this causes issue with `react/no-unescaped-entities` before
so now `mdx/no-unescaped-entities` and `eslint-plugin-react` dep can be removed!

fix #287

* ci: try codesandbox for releasing testing versions
@wooorm wooorm added ⛵️ status/released and removed 🐛 type/bug This is a problem 🙉 open/needs-info This needs some more info labels Apr 12, 2021
@wooorm wooorm added the 💪 phase/solved Post is done label Dec 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💪 phase/solved Post is done
Development

Successfully merging a pull request may close this issue.

2 participants