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.

V8.2.0 Init generated file is broken

See original GitHub issue

Failed to load plugin ‘import’ declared in ‘.eslintrc.js » eslint-config-airbnb » /Users/db/winering/core-web/node_modules/eslint-config-airbnb-base/index.js » /Users/db/winering/core-web/node_modules/eslint-config-airbnb-base/rules/imports.js’: Invalid URL: eslintrc.cjs

running node v16.13.0 running npm 8.1.0

"eslint": "^8.2.0",
"eslint-config-airbnb": "^19.0.0",
"eslint-plugin-import": "^2.25.3",
"eslint-plugin-jsx-a11y": "^6.5.1",
"eslint-plugin-react": "^7.27.0",
"eslint-plugin-react-hooks": "^4.3.0",
module.exports = {
  env: {
    browser: true,
    es2021: true,
  },
  extends: [
    'plugin:react/recommended',
    'airbnb',
  ],
  parserOptions: {
    ecmaFeatures: {
      jsx: true,
    },
    ecmaVersion: 13,
    sourceType: 'module',
  },
  plugins: [
    'react',
  ],
  rules: {
  },
};

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:12

github_iconTop GitHub Comments

2reactions
alexrudd2commented, Nov 15, 2021

@ljharb Thanks for the reply. I misunderstood the problem, and what appeared to work did not in fact persist after an Atom restart. My package.json does not have type: module, it’s just vanilla JS and we only use Node to install local packages such as eslint. I neither work with nor understand ESM modules, sorry 😃

My guess is that the way the imports plugin is imported changes some parser (?) to expect modules (?). https://github.com/airbnb/javascript/blob/d8cb404da74c302506f91e5928f30cc75109e74d/packages/eslint-config-airbnb-base/rules/imports.js#L1-L11

So my new workaround is to just disable those rules in index.js

module.exports = {
  extends: [
    './rules/best-practices',
    './rules/errors',
    './rules/node',
    './rules/style',
    './rules/variables',
    './rules/es6',
    // './rules/imports',
    './rules/strict',
  ].map(require.resolve),
  parserOptions: {
    ecmaVersion: 2018,
    sourceType: 'module',
  },
  rules: {},
};

Additionally, this bug seems related: https://github.com/AtomLinter/linter-eslint/issues/1448

0reactions
ljharbcommented, Nov 15, 2021

Yes, the airbnb config absolutely expects that you are authoring ESM and using babel to transpile it. If you’re not doing so, you either have to override a bunch of configuration things, or, you shouldn’t be using the airbnb config at all.

Read more comments on GitHub >

github_iconTop Results From Across the Web

"storybook init" builds wonky package-lock.json using npm v8
When using React v18 and npm v8, the storybook init command command creates ... Missing: require-from-string@2.0.2 from lock file npm ERR!
Read more >
Release Notes for WebSphere Transformation Extender ... - IBM
This document provides information about the release of WebSphere® Transformation Extender V8.2.0.4.
Read more >
What could cause an error related to npm not being able to ...
I have node 8.9.4, npm 5.6.0, and angular-CLI 1.5.0 installed as well as typescript 2.0.0. The latter two packages have been installed ...
Read more >
Bug listing with status RESOLVED with resolution OBSOLETE ...
systemPrefs with at least two files" status:RESOLVED resolution:OBSOLETE severity:normal ... Bug:107027 - "dev-vcs/cvsd init script for is not working" ...
Read more >
Fixes integrated in HCL Digital Experience 8.5.0.0, 9.0 and 9.5 ...
This page lists the individual problems fixed and delivered in the combined cumulative fixes ("CFs") for HCL Portal Server and HCL Web Content...
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