arnaud-dezandee / fast-eslint Goto Github PK
View Code? Open in Web Editor NEWAtom ESLint linter plugin for JavaScript
Home Page: https://atom.io/packages/fast-eslint
License: MIT License
Atom ESLint linter plugin for JavaScript
Home Page: https://atom.io/packages/fast-eslint
License: MIT License
[Enter steps to reproduce below:]
Atom Version: 1.7.3
System: Mac OS X 10.11.5
Thrown From: fast-eslint package, v2.11.0
Failed to activate the fast-eslint package
At Cannot find module 'lodash.uniq'
Error: Cannot find module 'lodash.uniq'
at Module._resolveFilename (module.js:338:15)
at Function.Module._resolveFilename (/opt/homebrew-cask/Caskroom/atom/1.6.0/Atom.app/Contents/Resources/app.asar/src/module-cache.js:383:52)
at Function.Module._load (module.js:289:25)
at Module.require (module.js:366:17)
at require (/opt/homebrew-cask/Caskroom/atom/1.6.0/Atom.app/Contents/Resources/app.asar/src/native-compile-cache.js:50:27)
at Object.<anonymous> (/Users/jonmadi/.atom/packages/fast-eslint/lib/exec.js:7:28)
at Module._compile (/opt/homebrew-cask/Caskroom/atom/1.6.0/Atom.app/Contents/Resources/app.asar/src/native-compile-cache.js:103:30)
at Object.defineProperty.value [as .js] (/opt/homebrew-cask/Caskroom/atom/1.6.0/Atom.app/Contents/Resources/app.asar/src/compile-cache.js:208:21)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:313:12)
at Module.require (module.js:366:17)
at require (/opt/homebrew-cask/Caskroom/atom/1.6.0/Atom.app/Contents/Resources/app.asar/src/native-compile-cache.js:50:27)
at Object.<anonymous> (/Users/jonmadi/.atom/packages/fast-eslint/lib/index.js:9:15)
at Module._compile (/opt/homebrew-cask/Caskroom/atom/1.6.0/Atom.app/Contents/Resources/app.asar/src/native-compile-cache.js:103:30)
at Object.defineProperty.value [as .js] (/opt/homebrew-cask/Caskroom/atom/1.6.0/Atom.app/Contents/Resources/app.asar/src/compile-cache.js:208:21)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:313:12)
at Module.require (module.js:366:17)
at require (/opt/homebrew-cask/Caskroom/atom/1.6.0/Atom.app/Contents/Resources/app.asar/src/native-compile-cache.js:50:27)
at Package.module.exports.Package.requireMainModule (/opt/homebrew-cask/Caskroom/atom/1.6.0/Atom.app/Contents/Resources/app.asar/src/package.js:715:27)
at Package.module.exports.Package.activateNow (/opt/homebrew-cask/Caskroom/atom/1.6.0/Atom.app/Contents/Resources/app.asar/src/package.js:173:16)
at /opt/homebrew-cask/Caskroom/atom/1.6.0/Atom.app/Contents/Resources/app.asar/src/package.js:156:32
at Package.module.exports.Package.measure (/opt/homebrew-cask/Caskroom/atom/1.6.0/Atom.app/Contents/Resources/app.asar/src/package.js:92:15)
at /opt/homebrew-cask/Caskroom/atom/1.6.0/Atom.app/Contents/Resources/app.asar/src/package.js:149:26
at Package.module.exports.Package.activate (/opt/homebrew-cask/Caskroom/atom/1.6.0/Atom.app/Contents/Resources/app.asar/src/package.js:146:34)
at PackageManager.module.exports.PackageManager.activatePackage (/opt/homebrew-cask/Caskroom/atom/1.6.0/Atom.app/Contents/Resources/app.asar/src/package-manager.js:538:21)
at /opt/homebrew-cask/Caskroom/atom/1.6.0/Atom.app/Contents/Resources/app.asar/src/package-manager.js:519:29
at Config.module.exports.Config.transactAsync (/opt/homebrew-cask/Caskroom/atom/1.6.0/Atom.app/Contents/Resources/app.asar/src/config.js:337:18)
at PackageManager.module.exports.PackageManager.activatePackages (/opt/homebrew-cask/Caskroom/atom/1.6.0/Atom.app/Contents/Resources/app.asar/src/package-manager.js:514:19)
at PackageManager.module.exports.PackageManager.activate (/opt/homebrew-cask/Caskroom/atom/1.6.0/Atom.app/Contents/Resources/app.asar/src/package-manager.js:497:46)
{
"core": {
"themes": [
"one-light-ui",
"chester-atom-syntax"
]
}
}
# User
atom-html-preview, v0.1.19
atomic-chrome, v0.3.0
chester-atom-syntax, v0.1.1
fast-eslint, v2.11.0
file-icons, v1.7.11
linter, v1.11.4
node-debugger, v1.7.0
# Dev
No dev packages
Occurs under package version 3.0.0
. To reproduce create an .eslintrc.js
file with the following contents and attempt to save or modify:
module.exports = {
env: {
es6: true,
node: true
},
extends: 'eslint:recommended',
parserOptions: {
ecmaVersion: 7,
sourceType: 'module',
ecmaFeatures: {
jsx: true,
experimentalObjectRestSpread: true,
}
},
plugins: [
'react'
],
rules: {}
}
Despite the message linting continues to function as expected.
[Enter steps to reproduce:]
Atom: 1.40.1 x64
Electron: 3.1.10
OS: DESKTOP-JDMKS56
Thrown From: fast-eslint package 4.11.0
Uncaught Error: Cannot find module 'eslint-config-standa'
Referenced from:
At C:\Users\AC2Return\.atom\packages\fast-eslint\node_modules\eslint\lib\config\config-file.js:463
Error: Cannot find module 'eslint-config-standa'
Referenced from:
at ModuleResolver.resolve (/packages/fast-eslint/node_modules/eslint/lib/util/module-resolver.js:72:19)
at resolve (/packages/fast-eslint/node_modules/eslint/lib/config/config-file.js:507:28)
at load (/packages/fast-eslint/node_modules/eslint/lib/config/config-file.js:579:26)
at configExtends.reduceRight (/packages/fast-eslint/node_modules/eslint/lib/config/config-file.js:453:36)
at Array.reduceRight (<anonymous>)
at applyExtends (/packages/fast-eslint/node_modules/eslint/lib/config/config-file.js:431:26)
at Object.loadObject (/packages/fast-eslint/node_modules/eslint/lib/config/config-file.js:566:35)
at /packages/fast-eslint/node_modules/eslint/lib/config.js:85:46)
at /packages/fast-eslint/node_modules/eslint/lib/cli-engine.js:466:23)
at /packages/fast-eslint/lib/exec.js:64:14
at exports.allowUnsafeNewFunction (/packages/fast-eslint/node_modules/loophole/lib/loophole.js:25:14)
at initEngine (/packages/fast-eslint/lib/exec.js:63:3)
at /packages/fast-eslint/lib/index.js:19:92
at onDidChangeKeyPath.e (~/AppData/Local/atom/app-1.40.1/resources/app/static/<embedded>:11:334305)
at emitter.on (~/AppData/Local/atom/app-1.40.1/resources/app/static/<embedded>:11:334486)
at Function.simpleDispatch (~/AppData/Local/atom/app-1.40.1/resources/app/static/<embedded>:11:1209208)
at Emitter.emit (~/AppData/Local/atom/app-1.40.1/resources/app/static/<embedded>:11:1210649)
at Config.emitChangeEvent (~/AppData/Local/atom/app-1.40.1/resources/app/static/<embedded>:11:336974)
at Config.setRawValue (~/AppData/Local/atom/app-1.40.1/resources/app/static/<embedded>:11:334214)
at Config.set (~/AppData/Local/atom/app-1.40.1/resources/app/static/<embedded>:11:330008)
at SettingsPanel.set (~/AppData/Local/atom/app-1.40.1/resources/app/static/<embedded>:14:2586610)
at ~/AppData/Local/atom/app-1.40.1/resources/app/static/<embedded>:14:2588254
at Function.simpleDispatch (~/AppData/Local/atom/app-1.40.1/resources/app/static/<embedded>:11:1209208)
at Emitter.emit (~/AppData/Local/atom/app-1.40.1/resources/app/static/<embedded>:11:1210649)
at TextBuffer.emitDidStopChangingEvent (~/AppData/Local/atom/app-1.40.1/resources/app/static/<embedded>:11:504867)
at later (~/AppData/Local/atom/app-1.40.1/resources/app/static/<embedded>:14:104393)
2x -4:06.2.0 schelp-syntax:toggle (input.hidden-input)
-2:20.5.0 atom-eslint-fix:run (input.hidden-input)
-1:50.6.0 core:backspace (input.hidden-input)
6x -1:47.8.0 core:move-right (input.hidden-input)
-1:42.3.0 core:backspace (input.hidden-input)
-1:22.4.0 textlint-auto-fixer:fix-current-file (button.btn.btn-primary)
atom-material-syntax 1.0.8
busy-signal 2.0.1
eslint-fixer 1.3.0
eslint-format 0.4.7
fast-eslint 4.11.0
intentions 1.1.5
jade-beautify 0.1.5
linter 2.3.1
linter-eslint 8.5.5
linter-ui-default 1.8.0
ruby-syntax-replacer 0.5.1
schelp-syntax 0.6.3
syntax-theme-auto-changer 0.9.4
textlint-auto-fixer 0.2.0
Opening any Javascript file is now causing an issue. Everything was working until I upgraded to the current fast-eslint version.
My .eslintrc:
{
"parser": "babel-eslint",
"env": {
"browser": true,
"node": true,
"es6": true
},
"rules": {
// needed for eslint
"strict": 0,
// react stuff
"react/jsx-boolean-value": 1,
"react/jsx-no-undef": 2,
"react/jsx-uses-react": 2,
"react/jsx-uses-vars": 1,
"react/no-did-mount-set-state": 1,
"react/no-did-update-set-state": 1,
"react/no-unknown-property": 1,
"react/react-in-jsx-scope": 1,
"react/self-closing-comp": 1,
"react/wrap-multilines": 1
},
"ecmaFeatures": {
"jsx": true,
"modules": true
},
"plugins": [
"react"
]
}
linter-jslint has the ability to disable linting if it doesn't fine the .jslintrc file. Would be cool if This package did the same.
The validator seems to fail when trying to validate code with a 'this' expression.
Can you somehow improve startup time? Right now it's the slowest package I use :)
Currently the version of eslint
specified in package.json
is 4.19.1
while the latest version of eslint
is 5.15.3
.
This is producing errors.
e.g) "array-element-newline": "consistent" option is excluded and making "fatal: Error" :-(
Hello !
I have update my fast-eslint version, and now everything broke.
Error: Cannot read config file: /Users/iryusa/.atom/packages/fast-eslint/node_modules/eslint-config-airbnb/node_modules/eslint-config-airbnb-base/rules/strict.js Error: ENOENT: no such file or directory, open '/Users/iryusa/.atom/packages/fast-eslint/node_modules/eslint-config-airbnb/node_modules/eslint-config-airbnb-base/rules/strict.js' Referenced from: airbnb Referenced from: /Users/iryusa/Workspace/mjml/.eslintrc
I guess this is because how npm 3 handles dependencies ? Can you take a look please ? :)
➜ node_modules node -v
v4.2.2
➜ node_modules npm -v
3.8.8
➜ node_modules pwd
/Users/iryusa/.atom/packages/fast-eslint/node_modules
➜ node_modules ls -l
total 0
drwxr-xr-x 17 iryusa staff 578 16 mai 15:46 atom-linter
drwxr-xr-x 11 iryusa staff 374 16 mai 15:46 atom-package-deps
drwxr-xr-x 8 iryusa staff 272 16 mai 15:46 babel-eslint
drwxr-xr-x 11 iryusa staff 374 16 mai 15:46 eslint
drwxr-xr-x 11 iryusa staff 374 16 mai 15:46 eslint-config-airbnb
drwxr-xr-x 10 iryusa staff 340 16 mai 15:46 eslint-config-airbnb-base
drwxr-xr-x 7 iryusa staff 238 16 mai 15:46 eslint-config-google
drwxr-xr-x 10 iryusa staff 340 16 mai 15:46 eslint-config-standard
drwxr-xr-x 9 iryusa staff 306 16 mai 15:46 eslint-config-standard-jsx
drwxr-xr-x 8 iryusa staff 272 16 mai 15:46 eslint-config-xo
drwxr-xr-x 10 iryusa staff 340 16 mai 15:46 eslint-plugin-babel
drwxr-xr-x 10 iryusa staff 340 16 mai 15:46 eslint-plugin-import
drwxr-xr-x 16 iryusa staff 544 16 mai 15:46 eslint-plugin-jsx-a11y
drwxr-xr-x 9 iryusa staff 306 16 mai 15:46 eslint-plugin-promise
drwxr-xr-x 7 iryusa staff 238 16 mai 15:46 eslint-plugin-react
drwxr-xr-x 10 iryusa staff 340 16 mai 15:46 eslint-plugin-standard
drwxr-xr-x 7 iryusa staff 238 16 mai 15:46 lodash.uniq
drwxr-xr-x 6 iryusa staff 204 16 mai 15:46 loophole
With the recent update I am getting the following error on our project.
Error: [object Object]: ESLint configuration is invalid: - Unexpected top-level property "ecmaFeatures".
Do you have any hint ? :)
Is there a way to make it work with other eslint-config files?
And I get a whole load of errors along the lines of:
/Users/thaggie/.atom/packages/fast-eslint/node_modules/eslint/conf/eslint.json:
Configuration for rule "no-alert" is invalid: Severity should be one of the following: 0 = off, 1 = warning, 2 = error (you passed "off").
Referenced from: /Users/thaggie/dev/data-play/.eslintrc.js
I've edited the file by hand following the instructions.
Tried adding jquery to the environment ("jquery ": true) but received an error "Environment key "jquery" is unknown". jQuery environment is declared as available at ESLint.org so I don't know what is an issue here exactly
I use webpack for my project and have aliases for directories in my webpack config. So, when I add
"settings": {
"import/resolver": "webpack"
}
to my .eslintrc
Atom hightlights all imports and says "Resolve error: unable to load resolver webpack". However cli version of eslint works as expected
An option allowing fast-eslint to not activate himself when no .eslintrc file is found in the project folder would be great.
For exemple, downloading and exploring a package from the web in atom trow error at each opening of a javascript file. Pretty annoying…
Even if this package is a great tool and serve is purpose more than nicely in a everyday workflow, this behavior make him a 'disable-right-away' kind of extension to me.
regards.
Hi!
I can't fully figure out the installation process. As far as I've got I should at least apm install fast-eslint
.
After that was done I've got somehow working linter. But that was when I worked in a directory with a .eslintrc.*
with defined extends: airbnb-base
and other plugins and ESlint installed locally. But even then I wasn't sure if fast-eslint was using config specified in the .eslintrc.*
.
After that I went to another dir with no npm-packages and configs installed (clear directory with only text files) and restart Atom. And in that case the fast-eslint plugin didn't work (I guess it couldn't get a config file).
At that point my question is what are certain steps to get this plugin work from any place in my system?
.eslintrc.*
in my home or other directories?Atom
-> Config...
specifying baseConfigExtends
property?Is it all mandatory or something is optional?
And one more thing - how can I make sure the fast-eslint is using a right config?
Thank you!
To reproduce the problem, just create a subdirectory, and create a project with npm, and installed every eslint dependencies.
$ mkdir -p ~/a/b
$ npm init -y
$ npm i -D eslint \
eslint-config-airbnb \
eslint-plugin-import \
eslint-plugin-jsx-a11y \
eslint-plugin-react
$ touch index.js
$ touch .eslintrc
Then put some rules inside the .eslintrc
, such as:
{
"extends": "airbnb",
"rules": {
"max-len": [1, 120, 2, {
"ignoreComments": true
}],
"no-param-reassign": 0,
"no-console": 0,
}
}
Let's try run atom
in the directory ~/a/b
,
~/a/b $ atom .
Type something in index.js
to verify the eslint
is working.
Now, let's try run atom
in the directory ~/a
~/a/b $ cd ..
~/a $ atom .
Then type something in index.js
, we got many errors about cannot find the modules.
Error: Cannot find module 'eslint-config-airbnb' Referenced from: /Users/taowang/a/b/.eslintrc
Error: Cannot find module 'eslint-config-airbnb'
Referenced from: /Users/taowang/a/b/.eslintrc
at Object.ModuleResolver.resolve (/Users/taowang/.atom/packages/fast-eslint/node_modules/eslint/lib/util/module-resolver.js:75:19)
at resolve (/Users/taowang/.atom/packages/fast-eslint/node_modules/eslint/lib/config/config-file.js:479:33)
at load (/Users/taowang/.atom/packages/fast-eslint/node_modules/eslint/lib/config/config-file.js:496:24)
at /Users/taowang/.atom/packages/fast-eslint/node_modules/eslint/lib/config/config-file.js:392:36
at Array.reduceRight (native)
at applyExtends (/Users/taowang/.atom/packages/fast-eslint/node_modules/eslint/lib/config/config-file.js:363:28)
at Object.load (/Users/taowang/.atom/packages/fast-eslint/node_modules/eslint/lib/config/config-file.js:530:22)
at loadConfig (/Users/taowang/.atom/packages/fast-eslint/node_modules/eslint/lib/config.js:64:33)
at getLocalConfig (/Users/taowang/.atom/packages/fast-eslint/node_modules/eslint/lib/config.js:136:23)
at Config.getConfig (/Users/taowang/.atom/packages/fast-eslint/node_modules/eslint/lib/config.js:263:22)
at processText (/Users/taowang/.atom/packages/fast-eslint/node_modules/eslint/lib/cli-engine.js:231:27)
at CLIEngine.executeOnText (/Users/taowang/.atom/packages/fast-eslint/node_modules/eslint/lib/cli-engine.js:761:26)
at /Users/taowang/.atom/packages/fast-eslint/lib/exec.js:73:24
at exports.allowUnsafeNewFunction (/Users/taowang/.atom/packages/fast-eslint/node_modules/loophole/lib/loophole.js:25:14)
at /Users/taowang/.atom/packages/fast-eslint/lib/exec.js:72:7
at exec (/Users/taowang/.atom/packages/fast-eslint/lib/exec.js:69:10)
at Object.lint (/Users/taowang/.atom/packages/fast-eslint/lib/index.js:48:16)
at promises.push.Promise.then._this.emitter.emit.linter (/Users/taowang/.atom/packages/linter/lib/linter-registry.js:63:26)
at /Users/taowang/.atom/packages/linter/lib/linter-registry.js:62:23
at Set.forEach (native)
at LinterRegistry.lint (/Users/taowang/.atom/packages/linter/lib/linter-registry.js:60:18)
at /Users/taowang/.atom/packages/linter/lib/linter.coffee:98:16
at Function.module.exports.Emitter.simpleDispatch (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/event-kit/lib/emitter.js:25:14)
at Emitter.module.exports.Emitter.emit (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/event-kit/lib/emitter.js:125:28)
at /Users/taowang/.atom/packages/linter/lib/editor-linter.js:86:22
at /Users/taowang/.atom/packages/linter/lib/helpers.coffee:25:18
I use custom eslint config package: https://github.com/concrete-cc/eslint-config-concrete-base
{
"extends": "concrete-base",
"parser": "babel-eslint",
"globals": {
"IS_PRODUCTION": true
},
"rules": {
"no-return-assign": 0
},
"settings": {
"import/resolver": "webpack"
}
}
And fast-eslint shows me package not found
I have an .eslintignore
in my project root folder, and when I open files that belongs in the ignore path, fast-eslint
go ahead and performed lint regardless.
The plugin seems to accept the configuration in my .eslintrc
file without a problem. So, I'm wondering if I'm missing some kind of configuration
The Fix button available if you hover over some style issues often applies its fix to a different line of code.
For example, if I hover over an object-curly-spacing issue and click the Fix button a space will be inserted at the end of the nearest comment instead of after the curly bracket. Just one of example of some very flaky Fix logic.
Not sure it is relevant but I am using airbnb-base config with the exception that I use semi: ["error", "never"].
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.