Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: un-ts/eslint-plugin-import-x
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.5.1
Choose a base ref
...
head repository: un-ts/eslint-plugin-import-x
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v0.5.2
Choose a head ref
  • 3 commits
  • 3 files changed
  • 1 contributor

Commits on Jul 15, 2015

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    fd3acb9 View commit details
  2. Verified

    This commit was signed with the committer’s verified signature.
    crazy-max CrazyMax
    Copy the full SHA
    bec4e08 View commit details
  3. 0.5.2

    benmosher committed Jul 15, 2015

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    e7d9c0d View commit details
Showing with 43 additions and 2 deletions.
  1. +35 −0 README.md
  2. +1 −1 package.json
  3. +7 −1 tests/lib/rules/named.js
35 changes: 35 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -5,6 +5,8 @@ eslint-plugin-import

This plugin intends to support linting of ES6 import syntax, and prevent issues with misspelling of file paths and import names. All the goodness that the ES6 static module syntax intends to provide, marked up in your editor.

**IF YOU ARE USING THIS WITH SUBLIME**: see the [bottom section](#sublimelinter-eslint) for important info.

**Current support**:

* Ensure imports point to a file/module that can be resolved. ([`no-unresolved`](#no-unresolved))
@@ -159,3 +161,36 @@ descendent of some meaningful root class (`React.Component` comes to mind).

So far, it's just a merged reduction of the history of this project, but I hope
to see it grow to become more than just that.

## SublimeLinter-eslint

Recently, SublimeLinter-eslint introduced a change to support `.eslintignore` files
which altered the way file paths are passed to ESLint when linting during editing.

See roadhump/SublimeLinter-eslint#58 for more details, but essentially, you may find
you need to add the following to a `.sublimelinterrc` file:

```json
{
"linters": {
"eslint": {
"args": ["--stdin-filename", "@"]
}
}
}
```

I also found that I needed to set `rc_search_limit` to `null`, which removes the file
hierarchy search limit when looking up the directory tree for `.sublimelinterrc`:

In Package Settings / SublimeLinter / User Settings:
```json
{
"user": {
"rc_search_limit": null
}
}
```

I believe this defaults to `3`, so you may not need to alter it depending on your
project folder max depth.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "eslint-plugin-import",
"version": "0.5.1",
"version": "0.5.2",
"description": "Import with sanity.",
"main": "index.js",
"directories": {
8 changes: 7 additions & 1 deletion tests/lib/rules/named.js
Original file line number Diff line number Diff line change
@@ -39,10 +39,16 @@ eslintTester.addRuleTest('lib/rules/named', {
}),

// ignore node modules by default
test({ code: 'import { foo } from "crypto"' })
test({ code: 'import { foo } from "crypto"' }),

test({ code: 'import { someThing } from "./module"' })
],

invalid: [
test({ code: 'import { somethingElse } from "./module"'
, errors: [ error('somethingElse', './module') ]
}),

test({ code: 'import { foo } from "crypto"'
, args: [2, 'all']
, errors: [ error('foo', 'crypto') ]}),