question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error: `sourceCode.isSpaceBetween is not a function Occurred while linting`

See original GitHub issue

ESLint config: { "extends": ["airbnb-typescript"], "parserOptions": { "project": "./tsconfig.json", }, "rules": { "semi": "error" } }

package.json: { "name": "prettier-test", "version": "1.0.0", "description": "", "main": "index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, "keywords": [], "author": "", "license": "ISC", "devDependencies": { "@typescript-eslint/eslint-plugin": "^2.19.2", "@typescript-eslint/parser": "^2.19.2", "eslint": "^6.1.0", "eslint-config-airbnb": "^18.0.1", "eslint-config-airbnb-typescript": "^7.0.0", "eslint-plugin-import": "^2.20.1", "eslint-plugin-jsx-a11y": "^6.2.3", "eslint-plugin-react": "^7.18.3", "eslint-plugin-react-hooks": "^1.7.0", "typescript": "^3.7.5" } }

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:6
  • Comments:14 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
colinmcparlandcommented, Mar 30, 2020

Resolved: turns out I had an old eslint version installed globally 😳

0reactions
zfaelcommented, Apr 1, 2020

having the same issue as you guys using the last version of eslint-config-airbnb-typescript! downgrading it to 6.2.3 seems to fix the issue.

// package.json

{
  "scripts": {
    "test:lint": "eslint --ext .ts src/"
  },
  "devDependencies": {
    "@typescript-eslint/eslint-plugin": "2.26.0",
    "@typescript-eslint/parser": "2.26.0",
    "eslint": "6.6.0",
    "eslint-config-airbnb-typescript": "6.3.2",
    "eslint-plugin-import": "2.20.2"
  }
}

// eslint

module.exports = {
    parser: '@typescript-eslint/parser',
    extends: [
      'airbnb-typescript/base'
    ],
    plugins: ['import'],
    env: {
      node: true,
    },
    parserOptions: {
      project: './tsconfig.json'
    }
  };

// tsconfig.json

{
  "compilerOptions": {
    "target": "ES2020",
    "module": "commonjs",
    "moduleResolution": "node",
    "resolveJsonModule": true,
    "allowJs": false,
    "noUnusedLocals": false,
    "noUnusedParameters": false,
    "esModuleInterop": true,
    "sourceMap": true,
    "outDir": "dist",
    "allowSyntheticDefaultImports": true,
    "removeComments": true,
    "preserveConstEnums": true,
    "baseUrl": ".",
    "lib": ["ES2020", "dom"],
    "typeRoots": ["src/types", "node_modules/@types"]
  },
  "include": ["src/**/*.ts"],
  "exclude": ["node_modules/**/*.ts"]
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeError: sourceCode.isSpaceBetween is not a function #2611
Weird this is happening only when running eslint, no warnings or errors show up while editing the file: eslintrc: module.exports ...
Read more >
Working with Rules - ESLint - Pluggable JavaScript Linter
"suggestion" means the rule is identifying something that could be done in a better way but no errors will occur if the code...
Read more >
Eslint configuration error when saving my code - Stack Overflow
Error while loading rule 'prettier/prettier': context.getPhysicalFilename is not a function Occurred while linting G:\quiz-app\src\index.js.
Read more >
@typescript-eslint/eslint-plugin | Yarn - Package Manager
Fast, reliable, and secure dependency management.
Read more >
eslint.js - Apple Open Source
defaultMaxListeners = 10; // Obviously not all Emitters should be limited to 10. This function allows // that to be increased. Set to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found