WebStorm.
prettier.config.js:
module.exports = {
singleQuote: true,
trailingComma: 'all',
arrowParens: 'avoid',
printWidth: 80,
embeddedLanguageFormatting: 'auto',
jsxBracketSameLine: true,
tabWidth: 2,
proseWrap: 'always',
semi: true,
bracketLine: false,
bracketSpacing: true,
};
.eslingrc.json:
{
"env": {
"browser": true,
"es2021": true
},
"extends": [
"plugin:react/recommended",
"airbnb",
"plugin:prettier/recommended"
],
"parser": "babel-eslint",
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": 12,
"sourceType": "module"
},
"plugins": [
"react",
"react-hooks",
"prettier"
],
"rules": {
"prettier/prettier": [
"error",
{
"endOfLine": "auto"
},
{
"usePrettierrc": true
}
],
"import/no-dynamic-require":"off",
"global-require": "off",
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "warn",
"no-use-before-define": "off",
"react/react-in-jsx-scope": "off",
"import/no-cycle": "off",
"react/prop-types": "off",
"react/jsx-filename-extension": "off",
"import/no-named-as-default": "off",
"import/no-named-as-default-member": "off",
"react/jsx-props-no-spreading": "off",
"no-param-reassign": "off",
"radix": "off",
"import/order": "off",
"no-plusplus": "off",
"no-underscore-dangle": "off",
"no-unused-expressions": "off",
"array-callback-return": "warn",
"react/jsx-no-bind": "off",
"class-methods-use-this": "off",
"consistent-return": "off",
"new-cap": "off",
"react/destructuring-assignment": "off",
"react/forbid-prop-types": "off",
"import/prefer-default-export": "off",
"react/no-unused-state": "warn",
"no-unused-vars": "warn",
"no-nested-ternary": "off",
"jsx-a11y/click-events-have-key-events": "off",
"jsx-a11y/no-static-element-interactions": "off",
"react/sort-comp": "off",
"jsx-a11y/anchor-is-valid": "off",
"no-return-assign": "warn",
"react/no-array-index-key": "warn",
"guard-for-in": "warn",
"no-restricted-syntax": "warn",
"max-classes-per-file": "off",
"react/state-in-constructor": "off",
"react/static-property-placement": "off",
"react/prefer-stateless-function": "off",
"react/no-did-update-set-state": "warn",
"camelcase": "off",
"prefer-destructuring": "warn",
"no-await-in-loop": "warn",
"no-restricted-globals": "off",
"no-bitwise": "off",
"eqeqeq": "warn",
"no-shadow": "warn",
"jsx-a11y/label-has-associated-control": "off",
"react/button-has-type": "off",
"array-bracket-spacing": ["error", "always"],
"object-curly-spacing": ["error", "always"]
}
}
Why??? The braceSpacing
option is not conspicuous at all, no matter what is specified or what the value is. Any values or if you do not specify the rule at all – requires the absence of spaces. Please help. I tried different versions of Prettier or ESLint.