Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow no semicolons in JavaScript #1754

Closed
KamilaBorowska opened this issue Jan 9, 2014 · 7 comments
Closed

Allow no semicolons in JavaScript #1754

KamilaBorowska opened this issue Jan 9, 2014 · 7 comments

Comments

@KamilaBorowska
Copy link

I really like code without semicolons. Ace is great, but the error reporting for JavaScript complains about my perfectly fine code without semicolons. Would it be possible to disable warnings about semicolons. All I'm interested in are real syntax errors, without style errors.

Sample code (JavaScript):

alert("Hello, world!")
@danyaPostfactum
Copy link
Contributor

Agree. Lint tools should be configurable. Since mode options support is added (10e2c30), it will be easy, similar to php inline mode option (3a864c6)

@danyaPostfactum
Copy link
Contributor

By the way, you can currently disable semicolon warnings by placing this comment in your code: /* jshint asi:true */

@adamjimenez
Copy link
Contributor

or you can do:

editor.session.$worker.send("changeOptions", [{asi: true}]);

@tiaod
Copy link

tiaod commented Mar 6, 2017

Any update of this?

@flawiddsouza
Copy link

flawiddsouza commented May 6, 2021

Doing this didn't work:

editor.session.$worker.send("changeOptions", [{asi: true}]);

as .$worker was null

Instead, this worked for me (in case someone needs it)

editor.session.on('changeMode', function(e, session) {
    if('ace/mode/javascript' === session.getMode().$id) {
        if(!!session.$worker) {
            session.$worker.send('changeOptions', [{
                asi: true // disable "Missing semicolon." warning in editor for JavaScript
            }])
        }
    }
})

@github-actions
Copy link

github-actions bot commented May 9, 2022

This issue has not received any attention in 1 year. If you want to keep this issue open, please leave a comment below and auto-close will be canceled.

@andrewnester
Copy link
Contributor

This is the default behaviour of JS linter we use, as indicated above it's possible to pass custom linting options to change that behaviour

@andrewnester andrewnester closed this as not planned Won't fix, can't repro, duplicate, stale Sep 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants