Skip to content
This repository has been archived by the owner on Sep 28, 2020. It is now read-only.

Cache option blocks configFile option #171

Closed
ghost opened this issue Apr 13, 2017 · 6 comments
Closed

Cache option blocks configFile option #171

ghost opened this issue Apr 13, 2017 · 6 comments

Comments

@ghost
Copy link

ghost commented Apr 13, 2017

Cache option is upper then configFile. Webpack rule doesnt use config file (tested with global eslint variable):

      {
        test: /\.(js|vue)$/,
        loader: "eslint-loader",
        include: /src/,
        enforce: "pre",
        options: {
          formatter: require("eslint-friendly-formatter"),
          cache: DEVELOPMENT,
          configFile:  path.resolve(__dirname, '.eslintrc.js'),
        }
      },

If cache option is lower then configFile is loaded but eslint doesnt read rules in .eslintrc.js

      {
        test: /\.(js|vue)$/,
        loader: "eslint-loader",
        include: /src/,
        enforce: "pre",
        options: {
          formatter: require("eslint-friendly-formatter"),
          configFile:  path.resolve(__dirname, '.eslintrc.js'),
          cache: DEVELOPMENT,
        }
      },
@MoOx
Copy link
Contributor

MoOx commented Apr 14, 2017

This does not make any sense. Objects are not ordered in JavaScript anyway.

@MoOx
Copy link
Contributor

MoOx commented Oct 30, 2017

Closing to due to lack of feedback.

@MoOx MoOx closed this as completed Oct 30, 2017
@hxlhxl
Copy link

hxlhxl commented Sep 25, 2018

This is truely happened and exausted my several hours。Some attention should be paid here.

cache-above
cache-down

{
    "parser": "babel-eslint",    // enforce: 'pre' fix import resolve
    "parserOptions": {
        "ecmaVersion": 6,
        "sourceType": "module",
        "ecmaFeatures": {
            "jsx": true,
            "modules": true
        }
    },
    "extends": [
        "eslint:recommended",
        "plugin:react/recommended"
    ],
    // provided by "eslint-plugin-react": "^7.11.1",
    "plugins": [
        "react"
    ],
    "rules": {
        "no-console": 0,
        "no-undef": 0,
        // disable requiring trailing commas because it might be nice to revert to
        // being JSON at some point, and I don't want to make big changes now.
        "comma-dangle": 0,
        // we support node 4
        "prefer-destructuring": 0,
    }
}
  "devDependencies": {
    "@babel/core": "^7.1.0",
    "@babel/plugin-proposal-export-namespace-from": "^7.0.0",
    "@babel/preset-env": "^7.1.0",
    "@babel/preset-react": "^7.0.0",
    "babel-eslint": "^9.0.0",
    "babel-loader": "^8.0.2",
    "babel-plugin-transform-class-properties": "^6.24.1",
    "eslint": "^5.6.0",
    "eslint-loader": "^2.1.1",
    "eslint-plugin-react": "^7.11.1",
    "html-loader": "^0.5.5",
    "html-webpack-plugin": "^3.2.0",
    "nodemon": "^1.18.4",
    "webpack": "^4.19.1",
    "webpack-cli": "^3.1.0",
    "webpack-dev-server": "^3.1.8",
    "webpack-merge": "^4.1.4"
  }

@MoOx
Copy link
Contributor

MoOx commented Sep 25, 2018

Please reopen an issue if necessary, with all the details you can as nobody that actually use this loader is maintaining it. I do the bare minimum but not even use it for months...

@galvarez421
Copy link

I can confirm that this is still an issue, although I'm not sure if the order of the cache property has anything to do with it. If I define configFile and cache is set to true, the configFile is not used. If I comment out cache: true, then the configFile is used.

@galvarez421
Copy link

This is possibly related to caching issues described in #190, #214, and #222.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants