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

Enabling Default Rules? #59

Open
Gwinert opened this issue Apr 21, 2017 · 4 comments
Open

Enabling Default Rules? #59

Gwinert opened this issue Apr 21, 2017 · 4 comments
Labels

Comments

@Gwinert
Copy link

Gwinert commented Apr 21, 2017

Hello, I read through the user-guide, and the read me, and many of the links provided, but I think I need further help activating specific default rules.
To turn on rules, all I need to do is create a "eslintrules.json" file in the "C:\Users%USERNAME%\AppData\Roaming\Brackets\extensions\user\brackets-eslint.eslintrules"
Directory? Or do I put these in the ".brackets.json" file in "C:\Users%USERNAME%\AppData\Roaming\Brackets\extensions\user\brackets-eslint" Directory?
If I do make my own file, do I just write the code like this?

{
   "env":{
	"node": 1
}
	"rules": {
		"constructor-super": "error",
		"no-case-declarations": "error",
		"no-class-assign": "error"
      }
}

or do I add these to the .brackets.json like so:

{
  "smartIndent": true,
  "spaceUnits": 2,
  "useTabChar": false,
  "language": {
    "javascript": {
      "linting.prefer": ["ESLint"],
      "linting.usePreferredOnly": true
    }
  }
"env":{
"node": 1
}
"rules": {
		"constructor-super": "error",
		"no-case-declarations": "error",
		"no-class-assign": "error"
      }
}

Let me know, guys! Thank you so much!

@zaggino
Copy link
Member

zaggino commented Apr 22, 2017

Hi, to configure rules, you need to put normal .eslintrc file into YOUR project, like this one: https://github.com/adobe/brackets/blob/master/.eslintrc.js

See more here: http://eslint.org/docs/user-guide/configuring
Or another project here: https://github.com/zaggino/brackets-git

@tweakimp
Copy link

I have similar problems understanding how to apply my own rules. With the post above me I can apply my own rules for one project, but how can I make the same configuration for all projects at the same time, globally for brackets?

@zaggino
Copy link
Member

zaggino commented Apr 26, 2017

@tweakimp It's not a good idea to allow global configuration. First of all, ESLint doesn't support it. Second, if you configure your rules anywhere but the project itself, and upload that project to github (or anywhere else), anyone that would download that project (including you on a different machine) would have no idea what rules are supposed to be used developing that project. That's why you should always use .eslintrc file in your project root.

@ghost
Copy link

ghost commented Feb 13, 2018

I dont understand anything about ESlint,some kind of errors are down in brackets but no point on exact line,think maybe this is a bad idea.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants