node.js - 进口应按字母顺序排序错误
问题描述
我的文件中有以下导入:
import axios from "axios";
import lodash from "lodash";
import PropTypes from "prop-types";
import React from "react";
import renderInCustomHtmlTag from "react-render-custom-html-tag";
我使用的是 v5.9.0,但由于某种原因,我收到第 3 行的错误,即使它似乎是按字母顺序排列的。
我的eslint如下:
{
"env": {
"browser": true,
"commonjs": true,
"es6" : true,
"jquery": true,
"node": true
},
"extends": [
"eslint:all",
"plugin:react/recommended"
],
"globals": {
"$cgx": true
},
"parser": "babel-eslint",
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"sourceType": "module"
},
"plugins": [
"import",
"jsx-a11y",
"react"
],
"rules": {
"indent": ["error", 2],
"max-len": [
"error",
{
"code": 120
}
]
}
}
解决方案
问题可能是大写字母。似乎是因为它们具有较低的 ASCII 值 A = 65,a = 97。
推荐阅读
- javascript - TypeError: [c++ 插件类] 不是构造函数
- javafx - javafx - 如果登录详细信息正确,登录函数将执行“else”块,但当详细信息错误时没有任何反应
- c++ - 如何计算文件中的生物数量?
- php - 购买产品(结帐页面)后保存到数据库 woocommerce 的位置在哪里?
- r - 如何修复美国地图中的重叠多边形?
- python - 按条件连接列表中的字符串
- javascript - 表单变量不通过 POST
- python - 从 BeautifulSoup 的表中排除跨度类
- python-3.x - 如何识别缩写/首字母缩略词并在 spaCy 中扩展它们?
- c# - 在 .NET Core 2.0 WebAPI 的 azure webapp 中加载应用程序设置