问题描述
我遇到了无法更改我的printWidth
设置的问题。无论我设置什么值,我都无法反映出printWidth
设置。
以前有人遇到过这个问题,还是在我的配置文件中看到任何明显的错误:
prittierrc.js
module.exports = {
printWidth: 500,singleQuote: true,trailingComma: 'all',};
eslintrc.js
const { off } = require('process');
module.exports = {
extends: ['airbnb','plugin:prettier/recommended','prettier/react'],env: {
browser: true,commonjs: true,es6: true,jest: true,node: true,},rules: {
'jsx-a11y/href-no-hash': ['off'],'react/jsx-filename-extension': ['warn',{ extensions: ['.js','.jsx'] }],'max-len': [
'warn',{
code: 500,tabWidth: 2,comments: 250,ignoreComments: false,ignoreTrailingComments: true,ignoreUrls: true,ignoreStrings: true,ignoreTemplateLiterals: true,ignoreRegExpLiterals: true,],'no-unused-vars': 'warn','no-console': 'off',};
编辑器的外观: click here for imgur url
它显然不反映printWidth: 500
设置
解决方法
检查配置文件名称的拼写。