-
-
Notifications
You must be signed in to change notification settings - Fork 292
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
0.44.0 eslint-config-prettier/flowtype.js error persists, prettier=false #595
Comments
later tried to do without prettier. I experimented with putting the configuration in package.json does xojs support @babel/eslint-parser, the renamed mono-repo version of babel-eslint-parser? // provide some config in params
+ "xo": "npx xo --space --no-semicolon --plugin=react --prettier=false",
// updated parser
+ "@babel/eslint-parser": "^7.15.0",
+ "eslint-config-standard": "^16.0.3",
+ "eslint-config-standard-jsx": "^10.0.0",
+ "eslint-config-xo-react": "^0.25.0",
+ "eslint-plugin-import": "^2.24.1",
+ "eslint-plugin-react": "^7.24.0",
// xo config
"xo": {
"envs": [
"browser",
"es2021"
],
"parser": "@babel/eslint-parser",
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"requireConfigFile": false,
"babelOptions": {
"plugins": [
"@babel/plugin-proposal-class-properties"
],
"presets": [
"@babel/preset-react"
]
}
},
"extends": [
"react-app",
"plugin:react/recommended",
"plugin:import/typescript",
"standard",
"standard-jsx",
"xo-react"
],
// It was difficult to determine which settings are expressed in which format.
// 1. field: value, like space: 2 or esnext: true (an xo shortcut?)
// 2. in rules: { object with documented, portable eslint syntax }
// 3. in overrides: {} (why this construct?
// if there is a precedence order for configs, all are "overrides"; the structure doesn't need to vary.
// maybe it's to make one config source, and overcome the unordered nature of attributes?
"esnext": true,
"eslint-env": "es6",
"semicolon": false,
"space": 2,
"object-curly-spacing": true,
"rules": {
"react/jsx-tag-spacing": [
"error",
{
"closingSlash": "never",
"beforeSelfClosing": "always",
"afterOpening": "never",
"beforeClosing": "never"
}
]
},
"quotes": [
"error",
"single"
],
"jsx-quotes": [
"error",
"prefer-single"
],
"react/jsx-tag-spacing": [
"error",
{
"closingSlash": "never",
"beforeSelfClosing": "always",
"afterOpening": "never",
"beforeClosing": "never"
}
],
"import/extensions": [
".cjs",
".js",
".jsx"
],
"node/file-extension-in-import": [
".js",
".jsx"
],
"import/no-useless-path-segments": 0,
"unicorn/import-index": 0,
"indentation": [
2,
{
"baseIndentLevel": 1
}
],
// this config was intended to allow different case for filenames.
// the experiment is generated by create-react-app. Classes and Components have TitleCase.
// scripts and configs are a mix of camelCase and kebab-case.
"unicorn/filename-case": [
"error",
{
"cases": {
"camelCase": true,
"pascalCase": true,
"kebabCase": true
}
}
]
} the filename-case rule had no effect (maybe it needed to be nested elsewhere?)
|
this file re-tab-indents and adds comma-dangle itself on-save. then it reports its transgressions. :) the rules are nested correctly now, in package.json "xo": {
"envs": [
"browser",
"es2021"
],
"parser": "@babel/eslint-parser",
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"requireConfigFile": false,
"babelOptions": {
"plugins": [
"@babel/plugin-proposal-class-properties"
],
"presets": [
"@babel/preset-react"
]
}
},
"extends": [
"react-app",
"plugin:react/recommended",
"plugin:import/typescript",
"standard",
"standard-jsx",
"xo-react"
],
"esnext": true,
"eslint-env": "es6",
"semicolon": false,
"space": 2,
"object-curly-spacing": true,
"rules": {
"import/extensions": [
2,
"never",
{
"css": "always",
"scss": "always",
"sass": "always"
}
],
"quotes": [
"error",
"single"
],
"jsx-quotes": [
"error",
"prefer-single"
],
"react/jsx-tag-spacing": [
"error",
{
"closingSlash": "never",
"beforeSelfClosing": "always",
"afterOpening": "never",
"beforeClosing": "never"
}
],
"node/file-extension-in-import": [0,
".js",
".jsx"
],
"import/no-useless-path-segments": 0,
"unicorn/import-index": 0,
"indent": ["error", 2],
"unicorn/filename-case": [
"error",
{
"cases": {
"camelCase": true,
"pascalCase": true,
"kebabCase": true
}
}
]
}
} |
v0.45.0 was just released, I think this issue is probably fixed there |
It's not clear how
|
I reproduced the prettier flowtypes error observed in #542 that was addressed in #583.
MacOs, node v14.17.3
context
intent: path to 'object-curly-spacing':true involves the fewest rules and additional deps.
The project is a create-react-app one about a year old.
steps
without prettier (desired)
the lines that fail:
with prettier
I don't really want prettier, but it seemed the likely way to get
object-curly-spacing
turned on.npx xo --space --no-semicolon --plugin=react --prettier=true "src/App.js"
Error: Cannot read config file:
xo-config.cjs
prettierrc.json
The text was updated successfully, but these errors were encountered: