sheerun / prettier-standard

Formats with Prettier and lints with ESLint+Standard! (✿◠‿◠)
MIT License
868 stars 44 forks source link

`.eslintrc` rules appear to be ignored #74

Closed kvz closed 5 years ago

kvz commented 5 years ago

Hi, thanks for this project, very needed! :)

I like my commas dangling but this rule (and others, e.g. vertical alignment around colons) seem to not be respected anymore.

Relevant config in .eslintrc:

  "extends": [
    "prettier/standard", "plugin:react/recommended"
  ],
  "env": {
    "es6": true,
    "jest": true,
    "node": true
  },
  "plugins": [
    "react", "prefer-import"
  ],
  "rules": {
    "camelcase": 0,
    "no-fallthrough": 0,
    "no-template-curly-in-string": 0,
    "react/prop-types": 0,
    "no-multi-spaces": 0,
    "prefer-import/prefer-import-over-require": [
      "error"
    ],
    "comma-dangle": [
      "error",
      "always-multiline"
    ],
    "key-spacing": [
      "error",
      {
        "multiLine": {
          "beforeColon": false,
          "afterColon": true
        },
        "align": {
          "beforeColon": false,
          "afterColon": true,
          "on": "colon",
          "mode": "strict"
        }
      }
    ]
  },

Running the command as "fix:js": "DEBUG=eslint:cli-engine prettier-standard '**/*.js'",

Got my devDependencies as such

    "eslint-plugin-import": "2.14.0",
    "eslint-plugin-node": "8.0.0",
    "eslint-plugin-prefer-import": "0.0.1",
    "eslint-plugin-promise": "4.0.1",
    "eslint-plugin-react": "7.11.1",
    "prettier-standard": "8.0.1",

And a source example that has it's trailing commas removed would be:

   this.setState({
      hasError: true,
      error,
      info, //< -- this comma gets killed
    })

Any idea what I am doing wrong?

sheerun commented 5 years ago

prettier-standard 9.0.0 has been released that respects only .prettierrc config and ignores .eslintrc

this is because prettier-standard 9 no longer passes code though eslint --fix, instead it uses just prettierx for formatting

havenchyk commented 4 years ago

@sheerun prettierx allows overriding of some rules e.g. Space before function parentheses, is it possible to do in prettier-standard?

sheerun commented 4 years ago

I think you can use .prettierrc

sospedra commented 4 years ago

I stumbled upon the same issue, does that mean that the docs are outdated?

sheerun commented 4 years ago

.eslintrc is for linting rules, .prettierrc is for whitespace rules