首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >更漂亮的错误`␍⏎···mapStateToProps,␍⏎···mapDispatchToProps,␍⏎··与`mapStateToProps,·mapDispatchToProps‘

更漂亮的错误`␍⏎···mapStateToProps,␍⏎···mapDispatchToProps,␍⏎··与`mapStateToProps,·mapDispatchToProps‘
EN

Stack Overflow用户
提问于 2020-09-18 09:12:51
回答 1查看 901关注 0票数 1

我遇到了以下错误消息Replace `␍⏎····mapStateToProps,␍⏎····mapDispatchToProps,␍⏎··` with `mapStateToProps,·mapDispatchToProps` prettier/prettier

在我的团队工作的人在他们的编辑中没有这个错误。我试着在VSCode中禁用我的eslint和更漂亮的插件,也在全球范围内禁用更漂亮的插件,但是没有运气。我还试图删除prettierrc.js

这是我的prettierrc.jseslintrc.js文件。但是这个错误仍然存在。

如有任何建议,将不胜感激。

代码语言:javascript
复制
module.exports = {
    printWidth: 80,
    tabWidth: 2,
    useTabs: false,
    semi: true,
    singleQuote: true,
    trailingComma: 'all',
    endOfLine: 'auto',
};

eslintrc.js

代码语言:javascript
复制
const path = require('path');

module.exports = {
  extends: [
    'airbnb',
    'plugin:import/errors',
    'plugin:import/warnings',
    'prettier',
    'prettier/react',
  ],
  plugins: ['flowtype', 'prettier', 'import'],
  parser: 'babel-eslint',
  rules: {
    'linebreak-style': 0,
    'prefer-const': 0,
    'spaced-comment': 0,
    'padded-blocks': 0,
    'import/imports-first': 0,
    'import/prefer-default-export': 0,
    'import/no-extraneous-dependencies': 0,
    'comma-dangle': 0,
    'no-shadow': 0,
    'arrow-body-style': 0,
    'quote-props': 0,
    'no-unused-vars': 1,
    'consistent-return': 0,
    'max-len': 0,
    'no-use-before-define': ['error', { functions: false, classes: true }],
    'no-underscore-dangle': 'off',
    'react/prefer-stateless-function': ['off'],
    'react/jsx-filename-extension': ['off'],
    'react/forbid-prop-types': ['off'],
    'editor.formatOnSave': true,
    // Enable per-language
    '[javascript]': {
      'editor.formatOnSave': true,
    },
    'react/no-danger': 0,
    'react/prop-types': 0,
    'no-throw-literal': 'error',
    'no-bitwise': ['off'],
    'dot-notation': ['off'],
    'prettier/prettier': ['error'],
    'flowtype/define-flow-type': 1,
    camelcase: ['off'],
    'jsx-a11y/label-has-for': ['off'],
    'no-nested-ternary': 'off',
    'react/no-this-in-sfc': 'off',
    'no-param-reassign': 'off',
    'react/sort-comp': [
      1,
      {
        order: [
          'static-methods',
          'instance-variables',
          'lifecycle',
          '/^on.+$/',
          'everything-else',
          'rendering',
        ],
        groups: {
          rendering: ['/^render.+$/', 'render'],
        },
      },
    ],
  },
  parserOptions: {
    ecmaVersion: 6,
    sourceType: 'module',
    ecmaFeatures: {
      spread: true,
      legacyDecorators: true,
    },
  },
  globals: {
    global: true,
    document: true,
    window: true,
  },
  settings: {
    'import/extensions': ['.js', '.jsx'],
    'import/parser': 'babel-eslint',
    'import/resolver': {
      // You can use only webpack but with this approach webstorm doesn't show
      // any red highlight for alias imports
      // If you forget to add alias here build still will work if there are aliases in
      // webpack.config but with this webstorm works better.
      // eslint-import-resolver-alias
      alias: [
        ['app', path.join(__dirname, 'src/app/')],
        ['assets', path.join(__dirname, 'src/assets/')],
        // ['TT', 'src/app/test/'],
      ],
      // It also works but with alias there are no red highlight in webstorm
      // and with this approach build works but I still see red highlights in webstorm
      // eslint-import-resolver-webpack
      webpack: {
        config: './webpack/webpack.prod.js',
      },
    },
  },
};
EN

回答 1

Stack Overflow用户

发布于 2020-12-30 06:31:48

auto.

  1. 检查vscode设置,以确保prettier.endOfLine没有设置为任何东西

configuration.

  1. 检查.editorconfig (如果有的话)与.prettierrc
  2. 没有冲突
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/63952803

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档