Skip to content
This repository has been archived by the owner on Mar 23, 2024. It is now read-only.

ability to ignore specific rule on specific line #486

Closed
mikesherov opened this issue Jun 30, 2014 · 8 comments
Closed

ability to ignore specific rule on specific line #486

mikesherov opened this issue Jun 30, 2014 · 8 comments
Milestone

Comments

@mikesherov
Copy link
Contributor

e.g.

// jscs maximumLineLength: false
kjkjfsdnfkndsknjjkdfsnkjsfdknfjdsknjfskjsndfkjnfskjnfdsknjfkjnsdkjnfkjnsdfkjnfskjnskdjn
// jscs maximumLineLength: true

Note, however, this does not imply inline re-configuration of rules. Only the ability to ignore or unignore an already configured rule for the line.

@mikesherov mikesherov added this to the 1.6 milestone Jun 30, 2014
@qfox
Copy link
Member

qfox commented Jun 30, 2014

What if it was disabled by config?

// jscs maximumLineLength: false
kjkjfsdnfkndsknjjkdfsnkjsfdknfjdsknjfskjsndfkjnfskjnfdsknjfkjnsdkjnfkjnsdfkjnfskjnskdjn
// jscs maximumLineLength: null

Like that?

@mikesherov
Copy link
Contributor Author

@zxqfox sorry, I'm not sure I understand what you're asking. This will allow the user to disable or enable reporting of errors for a specific rule. It will not allow re-configuration of a rule inline. However, #487 will allow you to specify the config for an individual file at the top of that file.

@qfox
Copy link
Member

qfox commented Jun 30, 2014

@mikesherov Seems like it enable or disable "global" configuration for the rest of file. But how to disable this?

For example. I have global config:

{
  "maximumLineLengh": 50
}

And a file with inline config:

//// here maximumLineLength is 50
// jscs maximumLineLength: 80
//// here maximumLineLength is 80
kjkjfsdnfkndsknjjkdfsnkjsfdknfjdsknjfskjsndfkjnfskjnfdsknjfkjnsdkjnfkjnsdfkjnfskjnskdjn
// jscs maximumLineLength: false
//// here maximumLineLength is disabled, but how to rollback this to 50?

@mikesherov
Copy link
Contributor Author

The rules go like this:

Configure using .jscsrc or config at top of file, enable or disable configured rule inline.

There is no situation where you can do maximumLineLength: 80 inline.

@qfox
Copy link
Member

qfox commented Jun 30, 2014

Ah. Got it. It's fine. Not so flexible as it could be but still fine.

@qfox
Copy link
Member

qfox commented Jun 30, 2014

@mikesherov For more sense it could be like enable/disable instead of true/false.

// jscs maximumLineLength: disable

@mrjoelkemp
Copy link
Member

I'd like to tackle this, unless @markelog wants it ;), to get the 1.6 milestone moving. It's not too far away from what I did for the file-wide config. Have we settled on the api?

@mikesherov
Copy link
Contributor Author

I'm almost done. It'll be done today. Thanks for the offer though @mrjoelkemp

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

No branches or pull requests

3 participants