factorial-io / factorial-frontend-stack

Modern frontend tooling with minimal configuration
http://factorial-io.github.io/factorial-frontend-stack/
6 stars 1 forks source link

Default eslint env should be `browser` #22

Closed mlnmln closed 5 years ago

mlnmln commented 5 years ago

IS: Currently no default env is set. This leads to lint errors (window, document) when migrating existing projects.

SHOULD: The default evironment should be browser.

mgrsskls commented 5 years ago

cli is fine for me now, but Sublime still complains about window, document, fetch etc. not being defined. I didn't change any of provided rc files, so basic setup.

mlnmln commented 5 years ago

@mgrsskls

Seems like the env variable is not correctly exposed through the IDE in .eslintrc.js.

For now you can use

// .eslintrc.js
const { Neutrino } = require('neutrino');

// Specify middleware to Neutrino prior to calling eslintrc.
// Even if using .neutrinorc.js, you must specify it when using
// the API
module.exports = {
  ...Neutrino({ root: __dirname })
    .use('.neutrinorc.js')
    .call('eslintrc'),
  env: {
    browser: true
  }
}

I'm working on a fix right now.

mlnmln commented 5 years ago

@mgrsskls This should be fixed in https://github.com/factorial-io/factorial-frontend-stack/releases/tag/%40factorial%2Ffrontend-stack-core%400.3.1

Working in VS code on my local.