Tabs and spaces are mixed with this code snippet.
See original GitHub issueVersions:
prettier-eslint
version: 8.8.2node
version: 10.9.0yarn
version: 1.9.4
Have you followed the debugging tips?
Yes
Relevant code or config
Offending snippet:
const configureStore = (initialState, initialReducers) => {
const store = createStore(
initialReducers
? combineReducers({
...initialReducers
})
: (state) => state,
initialState,
middlware
);
store.asyncReducers = initialReducers ? { ...initialReducers } : {};
return store;
};
.eslintrc.json:
{
"parser": "babel-eslint",
"extends": ["eslint:recommended", "plugin:react/recommended", "plugin:jsx-a11y/recommended"],
"env": {
"browser": true,
"node": true,
"es6": true
},
"parserOptions": {
"ecmaVersion": 2018,
"sourceType": "module",
"ecmaFeatures": {
"jsx": true
}
},
"rules": {
"newline-per-chained-call": ["error"],
"no-undef": "off",
"no-unused-vars": "warn",
"no-console": ["warn", { "allow": ["warn", "error"] }],
"react/jsx-uses-react": "error",
"react/jsx-uses-vars": "error",
"react/jsx-indent-props": ["error", "tab"],
"react/jsx-indent": ["error", "tab"],
"react/jsx-closing-bracket-location": ["error", "line-aligned"],
"react/jsx-max-props-per-line": ["error", { "maximum": 1 }],
"react/jsx-first-prop-new-line": ["error", "multiline-multiprop"]
},
"plugins": ["react", "jsx-a11y", "markdown"]
}
prettier.config.js:
module.exports = {
arrowParens: 'always',
printWidth: 100,
semi: true,
singleQuote: true,
tabWidth: 4,
useTabs: true
};
What I did:
Ran prettier-eslint
.
What happened:
Tabs and spaces were mixed for indentation.
Reproduction repository:
https://github.com/SurLaTable/slt-ui
Problem description:
Tabs and spaces should not be mixed. This is the specific area where they are mixed (second to last line):
? combineReducers({
...initialReducers
})
: (state) => state,
Suggested solution:
Do not allow prettier-eslint
to mix spaces and tabs for indentation.
Issue Analytics
- State:
- Created 5 years ago
- Comments:7
Top Results From Across the Web
Mixing Tabs & Spaces - Trey Hunner
Mixing Tabs & Spaces. Trey Hunner / @treyhunner. My name is Trey. I do corporate training and I teach online. My primary programming...
Read more >How to supress error: Mixed spaces and tabs? - Stack Overflow
Use an IDE like VS Code or WebStorm that doesn't include tabs at all and all tabs will be converted to spaces. –...
Read more >Why do I get alerts that say mixed spaces and tabs?
Have you tried this: select multiple lines of code,; press tab to indent them,; press shift + tab to move them all back....
Read more >Why do some people mix tabs and spaces in their code? - Quora
It's an easy mistake to make. The character combination "<space><tab>" at the beginning of a line looks exactly the same as "<tab>," if...
Read more >What are the downsides of mixing tabs and spaces? [duplicate]
spaces " war, because, as you've already discovered, it allows for variable depth of block indentation for the people who want it (via...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
As described here, is intended. Is not a bug.