O
O
Oborotenby2019-09-25 12:35:30
JavaScript
Oborotenby, 2019-09-25 12:35:30

Is there a linter that supports private methods and properties in JS?

The project is not very large, but it is completely tied to private methods and properties, we have been using them for about six months. Linter has not been used before.
I tried to install babel-eslint v10, the error falls. Googled, it seems like privacy will be supported from the 11th version. On the only beta of the 11th version, the parser error falls and it's not only me who has a lot of messages on the github that the 11th version is not working.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
O
Oborotenby, 2019-09-30
@Oborotenby

Pull request that solves the problem: https://github.com/babel/babel-eslint/pull/801

S
Sunflowerz, 2019-09-25
@Sunflowerz

Working config

{
  "parser": "babel-eslint",
  "parserOptions": {
          "ecmaFeatures": {
              "jsx": true,
              "globalReturn": false
          },
          "ecmaVersion": 2020,
          "sourceType": "module",
          "allowImportExportEverywhere": false,

          "requireConfigFile": true

      },
  "plugins": [
    "react",
    "babel"
  ],
  "globals": {
      "Atomics": "readonly",
      "SharedArrayBuffer": "readonly"
  },
  "extends": [
    "eslint:recommended",
    "plugin:jest/recommended"
  ],
  "rules": {
      "no-useless-escape": 0,
      "no-undef": 0,
      "no-extra-semi": 0,
      "no-extra-boolean-cast": 0
  },
  "env": {
      "browser": true,
      "es6": true
  }
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question