Skip to content
This repository has been archived by the owner on Aug 7, 2023. It is now read-only.

Commit

Permalink
Merge pull request #546 from AtomLinter/eslint-config-airbnb-base
Browse files Browse the repository at this point in the history
Move to eslint-config-airbnb-base
  • Loading branch information
Arcanemagus committed Apr 21, 2016
2 parents fc1c057 + 9c43918 commit e99dc13
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 53 deletions.
4 changes: 2 additions & 2 deletions lib/reporter.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';
// This file is used by eslint to hand the errors over to the worker
"use strict";

// This file is used by eslint to hand the errors over to the worker
module.exports = function (results) {
global.__LINTER_ESLINT_RESPONSE = results[0].messages;
};
10 changes: 1 addition & 9 deletions lib/worker-helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,21 +37,13 @@ var Cache = {
NODE_PREFIX_PATH: null,
LAST_MODULES_PATH: null
};
var assign = Object.assign || function (target, source) {
for (var key in source) {
if (source.hasOwnProperty(key)) {
target[key] = source[key];
}
}
return target;
};

function getNodePrefixPath() {
if (Cache.NODE_PREFIX_PATH === null) {
var npmCommand = process.platform === 'win32' ? 'npm.cmd' : 'npm';
try {
Cache.NODE_PREFIX_PATH = _child_process2.default.spawnSync(npmCommand, ['get', 'prefix'], {
env: assign(assign({}, process.env), { PATH: (0, _consistentPath2.default)() })
env: Object.assign(Object.assign({}, process.env), { PATH: (0, _consistentPath2.default)() })
}).output[1].toString().trim();
} catch (e) {
throw new Error('Unable to execute `npm get prefix`. Please make sure Atom is getting $PATH correctly');
Expand Down
37 changes: 12 additions & 25 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
"repository": "https://github.com/AtomLinter/linter-eslint.git",
"license": "MIT",
"engines": {
"atom": ">0.50.0"
"atom": ">=1.4.0 <2.0.0"
},
"scripts": {
"test": "npm run lint && apm test",
"lint": "eslint .",
"watch": "ucompiler watch",
"compile": "ucompiler go"
Expand All @@ -18,15 +19,13 @@
"atom-package-deps": "^4.0.1",
"consistent-path": "^2.0.1",
"escape-html": "^1.0.3",
"eslint": "^2.7.0",
"eslint": "^2.8.0",
"process-communication": "^1.1.0",
"resolve-env": "^1.0.0"
},
"devDependencies": {
"eslint-config-airbnb": "^7.0.0",
"eslint-plugin-import": "^1.2.0",
"eslint-plugin-react": "^4.3.0",
"eslint-plugin-jsx-a11y": "^0.6.2",
"eslint-config-airbnb-base": "^1.0.0",
"eslint-plugin-import": "^1.5.0",
"ucompiler": "^3.2.0",
"ucompiler-plugin-babel": "^3.0.0",
"ucompiler-plugin-newline": "^3.0.0",
Expand All @@ -44,28 +43,16 @@
},
"eslintConfig": {
"rules": {
"no-empty": 0,
"no-console": 0,
"no-new": 0,
"no-extra-semi": 1,
"semi": [
2,
"never"
],
"semi": [2, "never"],
"func-names": 0,
"strict": [
0,
"never"
],
"no-param-reassign": [
2,
{
"props": false
}
],
"comma-dangle": 0
"no-param-reassign": [2, { "props": false }],
"comma-dangle": 0,
"no-underscore-dangle": 0,
"global-require": 0,
"import/no-unresolved": [2, { "ignore": ["atom"] }]
},
"extends": "airbnb/base",
"extends": "airbnb-base",
"globals": {
"atom": "true"
},
Expand Down
6 changes: 2 additions & 4 deletions spec/.eslintrc
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
{
"globals": {
"waitsForPromise": true
},
"env": {
"jasmine": true
"jasmine": true,
"atomtest": true
}
}
2 changes: 0 additions & 2 deletions spec/common.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict'

const Path = require('path')

module.exports.getFixturesPath = function (path) {
Expand Down
6 changes: 5 additions & 1 deletion spec/fixtures/files/good.js
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
'use strict'
function foo() {
return 42
}

foo()
1 change: 0 additions & 1 deletion src/reporter.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
'use strict'
// This file is used by eslint to hand the errors over to the worker
module.exports = function (results) {
global.__LINTER_ESLINT_RESPONSE = results[0].messages
Expand Down
10 changes: 1 addition & 9 deletions src/worker-helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,14 @@ const Cache = {
NODE_PREFIX_PATH: null,
LAST_MODULES_PATH: null
}
const assign = Object.assign || function (target, source) {
for (const key in source) {
if (source.hasOwnProperty(key)) {
target[key] = source[key]
}
}
return target
}

export function getNodePrefixPath() {
if (Cache.NODE_PREFIX_PATH === null) {
const npmCommand = process.platform === 'win32' ? 'npm.cmd' : 'npm'
try {
Cache.NODE_PREFIX_PATH =
ChildProcess.spawnSync(npmCommand, ['get', 'prefix'], {
env: assign(assign({}, process.env), { PATH: getPath() })
env: Object.assign(Object.assign({}, process.env), { PATH: getPath() })
}).output[1].toString().trim()
} catch (e) {
throw new Error(
Expand Down

0 comments on commit e99dc13

Please sign in to comment.