Code Monkey home page Code Monkey logo

atom-lebab's Issues

Allow choosing the transforms to apply

With upgrade to Lebab 2.0 (pull request #1) it no more makes sense to enable all the transforms by default.

The main culprit is the exponent transform for ES7, but one should in general be allowed to pick which transforms he wants to apply (like the commonjs won't be applicable if you want to limit yourself to what browsers natively support, or the template transform might too aggressively refactor your string concatenations).

I see two main ways of achieving this:

  • Configuration option to specify the transforms to apply.
  • Separate menu items for applying each individual transform.

Uncaught SyntaxError: Unexpected token .

[Enter steps to reproduce:]

  1. highlight the following ui-router route for an Angular 1.6 application
    .state({ name: 'cases-info', url: '/{tenantId}/cases/{id}/info', template: require('packets/info/template.html'), controller: 'PacketInfoController', data: { pageTitle: 'Case Information', pageId: 'cases-show-info', }, resolve: { packet: /*@ngInject*/getPacket } })
  2. Press ctrl + option + K

Atom: 1.20.0 x64
Electron: 1.6.9
OS: Mac OS X 10.12.6
Thrown From: lebab package 0.10.0

Stack Trace

Uncaught SyntaxError: Unexpected token .

At /Users/jean/.atom/packages/lebab/node_modules/espree/espree.js:467

SyntaxError: Unexpected token .
    at Parser.instance.raise.instance.raiseRecoverable (/packages/lebab/node_modules/espree/espree.js:463:19)
    at Parser.instance.unexpected (/packages/lebab/node_modules/espree/espree.js:496:14)
    at /packages/lebab/node_modules/acorn/dist/acorn.js:2094:10)
    at Parser.parseExprAtom (/packages/lebab/node_modules/acorn-jsx/inject.js:383:24)
    at /packages/lebab/node_modules/acorn/dist/acorn.js:1955:19)
    at /packages/lebab/node_modules/acorn/dist/acorn.js:1932:17)
    at /packages/lebab/node_modules/acorn/dist/acorn.js:1874:19)
    at /packages/lebab/node_modules/acorn/dist/acorn.js:1857:19)
    at /packages/lebab/node_modules/acorn/dist/acorn.js:1832:19)
    at /packages/lebab/node_modules/acorn/dist/acorn.js:1803:19)
    at /packages/lebab/node_modules/acorn/dist/acorn.js:797:45)
    at /packages/lebab/node_modules/acorn/dist/acorn.js:690:23)
    at Parser.parseTopLevel (/packages/lebab/node_modules/espree/espree.js:316:34)
    at Parser.parse (/packages/lebab/node_modules/acorn/dist/acorn.js:543:15)
    at Object.parse (/packages/lebab/node_modules/acorn/dist/acorn.js:3669:37)
    at Object.parse (/packages/lebab/node_modules/espree/espree.js:762:21)
    at Object.parse (/packages/lebab/node_modules/lebab/lib/Parser.js:27:29)
    at Object.parse (/packages/lebab/node_modules/recast/lib/parser.js:27:32)
    at /packages/lebab/node_modules/lebab/lib/Transformer.js:66:36
    at Transformer.ignoringHashBangComment (/packages/lebab/node_modules/lebab/lib/Transformer.js:91:25)
    at Transformer.applyAllTransforms (/packages/lebab/node_modules/lebab/lib/Transformer.js:65:19)
    at Transformer.run (/packages/lebab/node_modules/lebab/lib/Transformer.js:56:20)
    at Object.exports.transform (/packages/lebab/node_modules/lebab/index.js:14:62)
    at Converter.convert (/packages/lebab/lib/Converter.js:13:40)
    at Object.convert (/packages/lebab/lib/lebab.js:30:40)
    at /packages/lebab/lib/lebab.js:16:24)
    at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app/src/command-registry.js:265:35)
    at /Applications/Atom.app/Contents/Resources/app/src/command-registry.js:3:65
    at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (/Applications/Atom.app/Contents/Resources/app/node_modules/atom-keymap/lib/keymap-manager.js:621:22)
    at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (/Applications/Atom.app/Contents/Resources/app/node_modules/atom-keymap/lib/keymap-manager.js:412:28)
    at WindowEventHandler.module.exports.WindowEventHandler.handleDocumentKeyEvent (/Applications/Atom.app/Contents/Resources/app/src/window-event-handler.js:100:42)
    at HTMLDocument.<anonymous> (/Applications/Atom.app/Contents/Resources/app/src/window-event-handler.js:3:65)

Commands

     -0:22.9.0 tree-view:show (atom-workspace.workspace.scrollbars-visible-when-scrolling)
     -0:08.7.0 lebab:convert (input.hidden-input)

Non-Core Packages

atom-beautify 0.30.5 
atom-jasmine 0.8.1 
atom-material-syntax 1.0.6 
atom-ternjs 0.18.3 
auto-detect-indentation 1.3.0 
autoclose-html 0.23.0 
autocomplete-modules 1.7.0 
emmet 2.4.3 
file-icons 2.1.11 
fonts 3.0.3 
git-projects 1.17.0 
highlight-selected 0.13.1 
language-cfml 0.17.1 
lebab 0.10.0 
pigments 0.40.2 
project-manager 3.3.5 
regex-railroad-diagram 0.19.3 
sort-lines 0.15.0 
todo-show 2.0.0 
tree-view-git-status 1.4.0 

Package name conflict with "lebab" dependency

Во время работы над 0.5.0 я столкнулся с проблемой обновления lebab по причине "установки самого себя", но установке/обновлению в атоме это не мешает

Что можно сделать:

  • переименовать пакет обратно в atom-lebab
  • найти способ ставить пакет из под самого себя
  • забить и просто менять имя пакета на время обновления

While working on 0.5.0 I encountered a problem updating lebab because "Refusing to install lebab as a dependency of itself", but the installation / update in atom is successful

What can be done:

  • Rename the package back to the atom-lebab
  • Find a way to install a package as a dependency of itself
  • Do not care and just change the name of the package on the upgrade time

Uncaught SyntaxError: Unexpected token !

[Enter steps to reproduce:]

  1. ...
  2. ...

Atom: 1.14.4 x64
Electron: 1.3.13
OS: elementary OS
Thrown From: lebab package 0.10.0

Stack Trace

Uncaught SyntaxError: Unexpected token !

At /home/gcfabri/.atom/packages/lebab/node_modules/espree/espree.js:443

SyntaxError: Unexpected token !
    at Parser.instance.raise.instance.raiseRecoverable (/packages/lebab/node_modules/espree/espree.js:439:19)
    at Parser.instance.unexpected (/packages/lebab/node_modules/espree/espree.js:472:14)
    at Parser.pp.jsx_parseIdentifier (/packages/lebab/node_modules/acorn-jsx/inject.js:191:12)
    at Parser.pp.jsx_parseNamespacedName (/packages/lebab/node_modules/acorn-jsx/inject.js:200:21)
    at Parser.pp.jsx_parseElementName (/packages/lebab/node_modules/acorn-jsx/inject.js:213:21)
    at Parser.pp.jsx_parseOpeningElementAt (/packages/lebab/node_modules/acorn-jsx/inject.js:287:22)
    at Parser.pp.jsx_parseElementAt (/packages/lebab/node_modules/acorn-jsx/inject.js:310:31)
    at Parser.pp.jsx_parseElement (/packages/lebab/node_modules/acorn-jsx/inject.js:359:17)
    at Parser.parseExprAtom (/packages/lebab/node_modules/acorn-jsx/inject.js:381:23)
    at /packages/lebab/node_modules/acorn/dist/acorn.js:1854:19)
    at /packages/lebab/node_modules/acorn/dist/acorn.js:1831:17)
    at /packages/lebab/node_modules/acorn/dist/acorn.js:1773:19)
    at /packages/lebab/node_modules/acorn/dist/acorn.js:1756:19)
    at /packages/lebab/node_modules/acorn/dist/acorn.js:1733:19)
    at /packages/lebab/node_modules/acorn/dist/acorn.js:1709:19)
    at /packages/lebab/node_modules/acorn/dist/acorn.js:767:45)
    at /packages/lebab/node_modules/acorn/dist/acorn.js:658:23)
    at Parser.parseTopLevel (/packages/lebab/node_modules/espree/espree.js:301:34)
    at Parser.parse (/packages/lebab/node_modules/acorn/dist/acorn.js:528:15)
    at Object.parse (/packages/lebab/node_modules/acorn/dist/acorn.js:3357:37)
    at Object.parse (/packages/lebab/node_modules/espree/espree.js:738:21)
    at Object.parse (/packages/lebab/node_modules/lebab/lib/Parser.js:27:29)
    at Object.parse (/packages/lebab/node_modules/recast/lib/parser.js:26:34)
    at /packages/lebab/node_modules/lebab/lib/Transformer.js:68:36
    at Transformer.ignoringHashBangComment (/packages/lebab/node_modules/lebab/lib/Transformer.js:95:25)
    at Transformer.applyAllTransforms (/packages/lebab/node_modules/lebab/lib/Transformer.js:67:19)
    at Transformer.run (/packages/lebab/node_modules/lebab/lib/Transformer.js:58:20)
    at Object.exports.transform (/packages/lebab/node_modules/lebab/index.js:14:62)
    at Converter.convert (/packages/lebab/lib/Converter.js:13:40)
    at Object.convert (/packages/lebab/lib/lebab.js:30:40)
    at /packages/lebab/lib/lebab.js:16:24)
    at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/app.asar/src/command-registry.js:259:29)
    at /app.asar/src/command-registry.js:3:59
    at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:599:16)
    at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:390:22)
    at WindowEventHandler.module.exports.WindowEventHandler.handleDocumentKeyEvent (/app.asar/src/window-event-handler.js:106:36)
    at /app.asar/src/window-event-handler.js:3:59)

Commands

     -1:53 tree-view:show (atom-workspace.workspace.scrollbars-visible-always.theme-base16-tomorrow-dark-theme.theme-one-dark-ui)
     -1:21.6.0 deprecation-cop:view (atom-workspace.workspace.scrollbars-visible-always.theme-base16-tomorrow-dark-theme.theme-one-dark-ui)
     -0:26 lebab:convert (input.hidden-input)

Non-Core Packages

angular-2-typeScript-snippets 0.6.3 
angularjs 0.4.0 
atom-beautify 0.29.17 
atom-typescript 10.1.14 
autoclose-html 0.23.0 
emmet 2.4.3 
file-icons 2.0.17 
foldingtext-for-atom 0.9.2 
git-plus 7.3.3 
highlight-selected 0.12.0 
keyboard-sounds 0.2.0 
lebab 0.10.0 
linter 1.11.23 
linter-bootlint 1.0.4 
linter-csslint 1.3.4 
linter-htmlhint 1.3.2 
linter-jshint 3.0.3 
linter-jsonlint 1.3.0 
linter-php 1.3.1 
linter-sass-lint 1.7.4 
linter-scss-lint 3.1.0 
linter-tslint 0.14.0 
markdown-writer 2.6.4 
minimap 4.26.8 
minimap-highlight-selected 4.5.0 
minimap-pigments 0.2.2 
pigments 0.39.0 
svg-preview 0.11.0 
todo-show 1.11.0 
typewriter-sounds 0.1.0 

Ignore warnings by default

I'm getting constantly annoyed by the the fact that having warnings stops the transforms from being applied.

  • This behavior is different from Lebab itself.
  • It's not like Lebab breaks your code when you ignore the warnings - all the warnings are really about cases where Lebab is unable to transform the code.
  • The actual idea of the warnings in Lebab is to notify user about code that he should transform manually.
  • Even when you do decide to not perform the transform after seeing the warnings, you can just press Undo to revert them.

Do not treat warnings as hard errors

While working on #3 I discovered that it's quite a nuisance that having warnings completely stops Atom-Lebab from working.

I think a better approach would be to show warnings, but still apply the changes.

Even better would be to show the warnings as a clickable list (like the ESLint plugin does) so one could easily jump into the location in code and fix the warning.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.