eslint/eslint — pull request #686 by lsegal (2014-03-19 07:49:56+00:00)
Title: Add RuleContext.filename property

This implements filename support for custom rules as per eslint/eslint#468.

I added filename as a bare property, but I'm open to making it getFilename() for consistency, even though it wouldn't be a PASSTHROUGH like the others.

The filename property is unresolved and passed through exactly as is read in from the CLI. I noticed there is a magic `process.eslintCwd` variable, so presumably if someone wanted to resolve the proper path they could do it with that. I'd bet most people just want the filenames as passed in from command line (or globs), though.

I did have to change the `eslint.verify` method signature to include filename before saveState. I could have done it the other way around, but it looks like saveState is used only in testing, so I figured it was safe to "break". Let me know if this is a problem-- I'm sure we can do this in a 100% backwards compatible way.

Tests are included and pass for me.