Skip to content

Commit 9766a3c

Browse files
committed
Update eslint
- Update JS files to pass eslint-config-i-am-meticulous
1 parent c655058 commit 9766a3c

17 files changed

+79
-26
lines changed

index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
1+
// builtin tooling
12
var path = require("path")
3+
4+
// external tooling
25
var assign = require("object-assign")
36
var postcss = require("postcss")
7+
8+
// internal tooling
49
var joinMedia = require("./lib/join-media")
510
var resolveId = require("./lib/resolve-id")
611
var loadContent = require("./lib/load-content")

lib/parse-statements.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1+
// external tooling
12
var valueParser = require("postcss-value-parser")
3+
4+
// extended tooling
25
var stringify = valueParser.stringify
36

47
function split(params, start) {

lib/process-content.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
1+
// builtin tooling
12
var path = require("path")
3+
4+
// external tooling
25
var postcss = require("postcss")
6+
7+
// placeholder tooling
38
var sugarss
49

510
module.exports = function processContent(

lib/resolve-id.js

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,5 @@
1+
// external tooling
12
var resolve = require("resolve")
2-
var jspmResolve
3-
// Works around https://github.com/jspm/jspm-cli/pull/1779 is released
4-
try {
5-
jspmResolve = require("pkg-resolve")
6-
}
7-
catch (ex) {
8-
// pass
9-
}
103

114
var moduleDirectories = [
125
"web_modules",
@@ -47,12 +40,6 @@ module.exports = function(id, base, options) {
4740
.catch(function() {
4841
return resolveModule(id, resolveOpts)
4942
})
50-
.catch(function() {
51-
return jspmResolve.default(id, {
52-
basedir: resolveOpts.basedir,
53-
extensions : resolveOpts.extensions,
54-
})
55-
})
5643
.catch(function() {
5744
if (paths.indexOf(base) === -1) {
5845
paths.unshift(base)

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,9 @@
2626
},
2727
"devDependencies": {
2828
"ava": "^0.16.0",
29-
"eslint": "^1.10.3",
30-
"eslint-config-i-am-meticulous": "^2.0.0",
29+
"eslint": "^3.19.0",
30+
"eslint-config-i-am-meticulous": "^6.0.1",
31+
"eslint-plugin-import": "^2.2.0",
3132
"npmpub": "^3.0.1",
3233
"postcss-scss": "^1.0.0",
3334
"sugarss": "^0.2.0"

test/custom-load.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1+
// external tooling
12
import test from "ava"
3+
4+
// internal tooling
25
import compareFixtures from "./helpers/compare-fixtures"
36

47
test.serial("should accept content", t => {

test/custom-resolve.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
1+
// builtin tooling
2+
import path from "path"
3+
4+
// external tooling
15
import test from "ava"
2-
import compareFixtures from "./helpers/compare-fixtures"
36
import postcss from "postcss"
7+
8+
// internal tooling
9+
import compareFixtures from "./helpers/compare-fixtures"
10+
11+
// plugin
412
import atImport from ".."
5-
import path from "path"
613

714
test.serial("should accept file", t => {
815
return compareFixtures(t, "custom-resolve-file", {

test/custom-syntax-parser.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1+
// external tooling
12
import test from "ava"
23
import scss from "postcss-scss"
34
import sugarss from "sugarss"
5+
6+
// internal tooling
47
import compareFixtures from "./helpers/compare-fixtures"
58
import compareFixturesExt from "./helpers/compare-fixtures-ext"
69

test/helpers/compare-fixtures-ext.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
1+
// builtin tooling
12
var fs = require("fs")
2-
var postcss = require("postcss")
3+
4+
// external tooling
35
var assign = require("object-assign")
6+
var postcss = require("postcss")
7+
8+
// plugin
49
var atImport = require("../..")
510

611
function read(name, ext) {

test/helpers/compare-fixtures.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
1+
// builtin tooling
12
var fs = require("fs")
2-
var postcss = require("postcss")
3+
4+
// external tooling
35
var assign = require("object-assign")
6+
var postcss = require("postcss")
7+
8+
// plugin
49
var atImport = require("../..")
510

611
function read(name) {

test/import-events.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
1+
// builtin tooling
2+
import { readFileSync } from "fs"
3+
import { resolve } from "path"
4+
5+
// external tooling
16
import test from "ava"
27
import postcss from "postcss"
8+
9+
// plugin
310
import atImport from ".."
4-
import { resolve } from "path"
5-
import { readFileSync } from "fs"
611

712
test("should have a callback that returns an object" +
813
" containing imported files", t => {

test/import.js

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
1-
import test from "ava"
2-
import path from "path"
1+
// builtin tooling
32
import { readFileSync } from "fs"
3+
import path from "path"
4+
5+
// external tooling
6+
import test from "ava"
47
import postcss from "postcss"
5-
import atImport from ".."
8+
9+
// internal tooling
610
import compareFixtures from "./helpers/compare-fixtures"
711

12+
// plugin
13+
import atImport from ".."
14+
815
test("should import stylsheets", t => {
916
return compareFixtures(t, "simple")
1017
})

test/lint.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1+
// external tooling
12
import test from "ava"
23
import postcss from "postcss"
4+
5+
// plugin
36
import atImport from ".."
47

58
const processor = postcss().use(atImport())

test/media.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1+
// external tooling
12
import test from "ava"
3+
4+
// internal tooling
25
import compareFixtures from "./helpers/compare-fixtures"
36

47
test("should resolve media queries of import statements", t => {

test/order.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1+
// external tooling
12
import test from "ava"
3+
4+
// internal tooling
25
import compareFixtures from "./helpers/compare-fixtures"
36

47
test(`should order nested imports correctly`, t => {

test/plugins.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
1+
// external tooling
12
import test from "ava"
23
import postcss from "postcss"
3-
import atImport from ".."
4+
5+
// internal tooling
46
import compareFixtures from "./helpers/compare-fixtures"
57

8+
// plugin
9+
import atImport from ".."
10+
611
test("should apply plugins to root", t => {
712
const atRules = []
813
const rules = []

test/resolve.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1+
// external tooling
12
import test from "ava"
3+
4+
// internal tooling
25
import compareFixtures from "./helpers/compare-fixtures"
36

47
test("should resolve relative to cwd", t => {

0 commit comments

Comments
 (0)