Jakub
Jakub

Reputation: 2709

How to configure ESlint to work both Mac and WIndows machines

I have a Nodejs project which uses ESLint to keep consistency. On my Mac machine, I have no troubles all works bur on Windows I got this error

No files matching the pattern "'./*'" were found.
Please check for typing mistakes in the pattern.

My setup for ESLint is

{
    "env": {
        "es6": true,
        "node": true
    },
    "extends": [
        "plugin:prettier/recommended",
        "airbnb-base"
    ],
    "plugins": [
        "prettier"
    ],
    "globals": {
        "Atomics": "readonly",
        "SharedArrayBuffer": "readonly"
    },
    "parserOptions": {
        "ecmaVersion": 2018,
        "sourceType": "module"
    },
    "rules": {
        "prettier/prettier": "error",
        "linebreak-style": "off"
    }
}

Package.json

{
  "name": "new-architecture-solution",
  "version": "1.0.0",
  "description": "",
  "main": "server.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "prod": "node -r esm server.js",
    "dev": "nodemon -r esm server.js",
    "debug": "ndb nodemon -r esm server.js",
    "lint": "eslint . --ext .js,.jsx --quiet",
    "fix": "eslint './*' --fix",
    "prettier": "prettier --write src/**/*.{js,css}"
  },
  "husky": {
    "hooks": {
      "pre-commit": "lint-staged"
    }
  },
  "eslintIgnore": [
    "package.json",
    "package-lock.json",
    "combined.log",
    "swagger.json",
    "README.md"
  ],
  "lint-staged": {
    "./**/*.{js,jsx,ts,tsx,json,css,scss,md}": [
      "npm run prettier",
      "npm run lint --color",
      "npm run fix",
      "git add"
    ]
  },

I'm unable to find asolution and I would like to have it work in both my machines

Upvotes: 2

Views: 2278

Answers (1)

e-one
e-one

Reputation: 91

I haven't tried it yet on Windows, but according to this post replacing the single quotes with \" might do the trick. I've tried it on my Mac and it seems to work properly.

Edit: confirmed to work on Windows machines as well.

Upvotes: 3

Related Questions