Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
2a9e9d4
tools: use no-use-before-define ESLint rule
vsemozhetbyt Jul 1, 2017
7b53be0
test: fix flaky test-https-set-timeout-server
Trott Jul 8, 2017
d35e5c7
test: fix flaky http(s)-set-server-timeout tests
Trott Jul 20, 2017
194836f
v8: handle proxy objects in MakeMirror(), v1
bnoordhuis Jul 24, 2017
5a93c16
v8: handle proxy objects in MakeMirror(), v2
bnoordhuis Jul 24, 2017
ae3e7be
v8: fix RegExp nits in v8_prof_polyfill.js
vsemozhetbyt Jun 15, 2017
c96e938
tools: update to ESLint 4.1.0
Trott Jun 24, 2017
58e0c5c
tools: add script to update ESLint
Trott Jun 24, 2017
05ee559
tools: update to ESLint 4.1.1
Trott Jun 27, 2017
175d46e
test: skip test-fs-readdir-ucs2 if no support
Trott Jul 1, 2017
9320db0
tools: remove align-multiline-assignment lint rule
Trott Jul 5, 2017
e8c0e0f
lib: use consistent indentation for ternaries
Trott Jul 5, 2017
5e6c711
lib: remove excess indentation
Trott Jul 5, 2017
a75ba80
lib: normalize indentation in parentheses
Trott Jul 7, 2017
5ef17b7
lib: update indentation of ternaries
Trott Jul 15, 2017
b0f8bc9
test: adjust indentation for stricter linting
Trott Jul 25, 2017
5f7827d
doc: fix indentation issues in sample code
Trott Jun 27, 2017
f46e14c
tools: remove legacy indentation linting
Trott Aug 15, 2017
e0f8b18
src: remove GTEST_DONT_DEFINE_ASSERT_EQ in util.h
danbev Apr 25, 2017
44d3047
test: simplify test skipping
vsemozhetbyt Jun 30, 2017
162bc81
build,windows: implement PEP514 python detection
refack Jun 24, 2017
970fe59
build,windows: restore DISTTYPEDIR
refack Jun 28, 2017
1b9563a
build,win: fix python detection script
jasongin Jul 31, 2017
124d5e1
tools: generate template literal for addon tests
Trott Jul 5, 2017
f868b75
doc,test: fs - reserved characters under win32
XadillaX Jul 4, 2017
7a1ff59
doc: fix mistake in http.md
galeo Jul 7, 2017
6624a02
doc: note 'resize' event conditions on Windows
Dean-Coakley Jun 9, 2017
584f0f4
doc: correct stream Duplex allowHalfOpen doc
Trott Jul 7, 2017
5c3fd35
test: add get/set effective uid/gid tests
evanlucas Jul 5, 2017
3bd0c7c
test: remove common.noop
Trott May 4, 2017
ec68f07
tools: update ESLint to 4.2.0
Trott Aug 16, 2017
f395b48
tools: update package.json `engine` field
strugee Jul 12, 2017
98466c5
doc: update umask for clarity
jsumners Jul 11, 2017
b646c2a
benchmark: fix typo in inspect-proxy
vsemozhetbyt Jul 14, 2017
b89e806
test: fix flaky test-net-can-reset-timeout
Trott Jul 15, 2017
ed6d4f0
test: check complete error message
fraserxu Jul 16, 2017
b64fe2e
test: use regular expression to match error msg
Amunu Jul 16, 2017
a71e23a
test: use regluar expression in vm test
AkiraXue Jul 16, 2017
49312cb
test: use regexp to confir error message
bangwu Jul 16, 2017
d462267
test: simplify string concatenation
jiangplus Jul 16, 2017
a4281c6
test: use template literal for string concat
whatwewant Jul 16, 2017
f84a7a6
test: use regex error checks in test-util-format
superwoods Jul 16, 2017
41e4e46
doc: move LTS README link to increase prominence
gibfahn Jul 16, 2017
5303db7
http: OutgoingMessage change writable after end
Kasher Jun 30, 2017
01d7d30
gyp: implement LD/LDXX for ninja and FIPS
sam-github Jul 13, 2017
2039435
test: check error with regex in test-signal-safety
shaman2009 Jul 16, 2017
3148bc7
test: use regex error check in test-crypto-random
f48vj Jul 16, 2017
1e10f9f
test: fix error handling test-http-full-response
Trott Jul 15, 2017
3be54c8
test: replace concatenation with template literals
csvwolf Jul 16, 2017
1a8bf8a
doc,stream: _transform happens one at a time
mcollina Jul 17, 2017
1703871
doc: replace dead link in v8 module
drboyer Jul 19, 2017
028f650
docs: add note about fs.rmdir()
Oleksandr-Kushchak-i2 Jul 17, 2017
49662f3
build,tools: do not force codesign prefix
evanlucas Jul 12, 2017
1209832
build: codesign tarball binary on macOS
evanlucas Jul 12, 2017
bc1d4c5
test: use path.join for long path concatenation
jankjn Jul 16, 2017
b21a42d
doc: add XadillaX to collaborators
XadillaX Jul 20, 2017
9aa4a5b
test: replace string concatenation with template
Jul 16, 2017
6e08ae0
test: replace concatenation with template literals
leizongmin Jul 16, 2017
c3bb07c
doc: describe labelling process for backports
addaleax Apr 15, 2017
6e65501
deps: cherry-pick 18ea996 from c-ares upstream
addaleax Jul 15, 2017
ad86c26
doc: update experimental status to reflect use
jasnell Apr 28, 2017
fd5d6c9
test: replace concatenation with template literal
HSUCHING Jul 16, 2017
cdcec0c
test: replace concatenation with template literal
rockcoder23 Jul 16, 2017
b9a5253
test: fix flaky test-force-repl
Trott Jul 23, 2017
baa11a1
test: improve error logging for inspector test
Trott Jul 27, 2017
7c542ab
buffer: remove a wrongly added attribute specifier
hujiajie Jul 24, 2017
1232d9d
linkedlist: correct grammar in comments
alexbostock Jul 30, 2017
9132f37
test: add check on an addon that does not register
ezequielgarcia Jun 28, 2017
435ab00
test: refactor test-vm-new-script-new-context
Trott Jul 29, 2017
014a9bd
test: refactor test-domain-abort-on-uncaught
Trott Jul 30, 2017
071018e
src: use existing strings over creating new ones
addaleax Aug 2, 2017
403c465
doc: add gabrielschulhof to collaborators
Aug 8, 2017
567acf6
tools: update to ESLint 4.3.0
Trott Jul 21, 2017
1bba740
build: add cpp linting to windows build
Mar 15, 2017
78efc8c
build: split up cpplint to avoid long cmd lines
kfarnung Jul 6, 2017
180bec1
build: add lint option to vcbuild.bat help
brennemo Mar 22, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
tools: update to ESLint 4.1.1
PR-URL: #13946
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Refael Ackermann <[email protected]>
Reviewed-By: Daniel Bevenius <[email protected]>
Reviewed-By: Yuta Hiroto <[email protected]>
Reviewed-By: James M Snell <[email protected]>
  • Loading branch information
Trott authored and MylesBorins committed Aug 16, 2017
commit 05ee559fa61011e8d38eda18daaa4f5e0b52ff40
3 changes: 2 additions & 1 deletion tools/eslint/lib/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,14 @@ class Config {
this.parser = options.parser;
this.parserOptions = options.parserOptions || {};

this.configCache = new ConfigCache();

this.baseConfig = options.baseConfig
? ConfigOps.merge({}, ConfigFile.loadObject(options.baseConfig, this))
: { rules: {} };
this.baseConfig.filePath = "";
this.baseConfig.baseDirectory = this.options.cwd;

this.configCache = new ConfigCache();
this.configCache.setConfig(this.baseConfig.filePath, this.baseConfig);
this.configCache.setMergedVectorConfig(this.baseConfig.filePath, this.baseConfig);

Expand Down
24 changes: 12 additions & 12 deletions tools/eslint/lib/config/config-cache.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,36 +24,38 @@ function hash(vector) {
//------------------------------------------------------------------------------

/**
* Configuration caching class (not exported)
* Configuration caching class
*/
class ConfigCache {
module.exports = class ConfigCache {

constructor() {
this.filePathCache = new Map();
this.configFullNameCache = new Map();
this.localHierarchyCache = new Map();
this.mergedVectorCache = new Map();
this.mergedCache = new Map();
}

/**
* Gets a config object from the cache for the specified config file path.
* @param {string} configFilePath the absolute path to the config file
* @param {string} configFullName the name of the configuration as used in the eslint config(e.g. 'plugin:node/recommended'),
* or the absolute path to a config file. This should uniquely identify a config.
* @returns {Object|null} config object, if found in the cache, otherwise null
* @private
*/
getConfig(configFilePath) {
return this.filePathCache.get(configFilePath);
getConfig(configFullName) {
return this.configFullNameCache.get(configFullName);
}

/**
* Sets a config object in the cache for the specified config file path.
* @param {string} configFilePath the absolute path to the config file
* @param {string} configFullName the name of the configuration as used in the eslint config(e.g. 'plugin:node/recommended'),
* or the absolute path to a config file. This should uniquely identify a config.
* @param {Object} config the config object to add to the cache
* @returns {void}
* @private
*/
setConfig(configFilePath, config) {
this.filePathCache.set(configFilePath, config);
setConfig(configFullName, config) {
this.configFullNameCache.set(configFullName, config);
}

/**
Expand Down Expand Up @@ -125,6 +127,4 @@ class ConfigCache {
setMergedConfig(vector, config) {
this.mergedCache.set(hash(vector), config);
}
}

module.exports = ConfigCache;
};
18 changes: 11 additions & 7 deletions tools/eslint/lib/config/config-file.js
Original file line number Diff line number Diff line change
Expand Up @@ -488,12 +488,15 @@ function normalizePackageName(name, prefix) {
* @returns {Object} An object containing 3 properties:
* - 'filePath' (required) the resolved path that can be used directly to load the configuration.
* - 'configName' the name of the configuration inside the plugin.
* - 'configFullName' the name of the configuration as used in the eslint config (e.g. 'plugin:node/recommended').
* - 'configFullName' (required) the name of the configuration as used in the eslint config(e.g. 'plugin:node/recommended'),
* or the absolute path to a config file. This should uniquely identify a config.
* @private
*/
function resolve(filePath, relativeTo) {
if (isFilePath(filePath)) {
return { filePath: path.resolve(relativeTo || "", filePath) };
const fullPath = path.resolve(relativeTo || "", filePath);

return { filePath: fullPath, configFullName: fullPath };
}
let normalizedPackageName;

Expand All @@ -510,7 +513,7 @@ function resolve(filePath, relativeTo) {
normalizedPackageName = normalizePackageName(filePath, "eslint-config");
debug(`Attempting to resolve ${normalizedPackageName}`);
filePath = resolver.resolve(normalizedPackageName, getLookupPath(relativeTo));
return { filePath };
return { filePath, configFullName: filePath };


}
Expand Down Expand Up @@ -560,11 +563,12 @@ function loadFromDisk(resolvedPath, configContext) {
/**
* Loads a config object, applying extends if present.
* @param {Object} configObject a config object to load
* @param {Config} configContext Context for the config instance
* @returns {Object} the config object with extends applied if present, or the passed config if not
* @private
*/
function loadObject(configObject) {
return configObject.extends ? applyExtends(configObject, "") : configObject;
function loadObject(configObject, configContext) {
return configObject.extends ? applyExtends(configObject, configContext, "") : configObject;
}

/**
Expand All @@ -579,7 +583,7 @@ function loadObject(configObject) {
function load(filePath, configContext, relativeTo) {
const resolvedPath = resolve(filePath, relativeTo);

const cachedConfig = configContext.configCache.getConfig(resolvedPath.filePath);
const cachedConfig = configContext.configCache.getConfig(resolvedPath.configFullName);

if (cachedConfig) {
return cachedConfig;
Expand All @@ -590,7 +594,7 @@ function load(filePath, configContext, relativeTo) {
if (config) {
config.filePath = resolvedPath.filePath;
config.baseDirectory = path.dirname(resolvedPath.filePath);
configContext.configCache.setConfig(resolvedPath.filePath, config);
configContext.configCache.setConfig(resolvedPath.configFullName, config);
}

return config;
Expand Down
66 changes: 58 additions & 8 deletions tools/eslint/lib/rules/indent.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,8 @@ class OffsetStorage {

/**
* Sets the offset column of token B to match the offset column of token A.
* This is different from matchIndentOf because it matches a *column*, even if baseToken is not
* the first token on its line.
* **WARNING**: This is different from matchIndentOf because it matches a *column*, even if baseToken is not
* the first token on its line. In most cases, `matchIndentOf` should be used instead.
* @param {Token} baseToken The first token
* @param {Token} offsetToken The second token, whose offset should be matched to the first token
* @returns {void}
Expand All @@ -239,12 +239,62 @@ class OffsetStorage {
}

/**
* Sets the desired offset of a token
* @param {Token} token The token
* @param {Token} offsetFrom The token that this is offset from
* @param {number} offset The desired indent level
* @returns {void}
*/
* Sets the desired offset of a token.
*
* This uses a line-based offset collapsing behavior to handle tokens on the same line.
* For example, consider the following two cases:
*
* (
* [
* bar
* ]
* )
*
* ([
* bar
* ])
*
* Based on the first case, it's clear that the `bar` token needs to have an offset of 1 indent level (4 spaces) from
* the `[` token, and the `[` token has to have an offset of 1 indent level from the `(` token. Since the `(` token is
* the first on its line (with an indent of 0 spaces), the `bar` token needs to be offset by 2 indent levels (8 spaces)
* from the start of its line.
*
* However, in the second case `bar` should only be indented by 4 spaces. This is because the offset of 1 indent level
* between the `(` and the `[` tokens gets "collapsed" because the two tokens are on the same line. As a result, the
* `(` token is mapped to the `[` token with an offset of 0, and the rule correctly decides that `bar` should be indented
* by 1 indent level from the start of the line.
*
* This is useful because rule listeners can usually just call `setDesiredOffset` for all the tokens in the node,
* without needing to check which lines those tokens are on.
*
* Note that since collapsing only occurs when two tokens are on the same line, there are a few cases where non-intuitive
* behavior can occur. For example, consider the following cases:
*
* foo(
* ).
* bar(
* baz
* )
*
* foo(
* ).bar(
* baz
* )
*
* Based on the first example, it would seem that `bar` should be offset by 1 indent level from `foo`, and `baz`
* should be offset by 1 indent level from `bar`. However, this is not correct, because it would result in `baz`
* being indented by 2 indent levels in the second case (since `foo`, `bar`, and `baz` are all on separate lines, no
* collapsing would occur).
*
* Instead, the correct way would be to offset `baz` by 1 level from `bar`, offset `bar` by 1 level from the `)`, and
* offset the `)` by 0 levels from `foo`. This ensures that the offset between `bar` and the `)` are correctly collapsed
* in the second case.
*
* @param {Token} token The token
* @param {Token} offsetFrom The token that `token` should be offset from
* @param {number} offset The desired indent level
* @returns {void}
*/
setDesiredOffset(token, offsetFrom, offset) {
if (offsetFrom && token.loc.start.line === offsetFrom.loc.start.line) {
this.matchIndentOf(offsetFrom, token);
Expand Down
2 changes: 1 addition & 1 deletion tools/eslint/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 11 additions & 11 deletions tools/eslint/package.json
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
{
"_from": "eslint@4.1.0",
"_id": "[email protected].0",
"_from": "eslint@latest",
"_id": "[email protected].1",
"_inBundle": false,
"_integrity": "sha1-u7VaKCIO4Itp2pVU1FprLr/X2RM=",
"_integrity": "sha1-+svfz+Pg+s06i4DcmMTmwTrlgt8=",
"_location": "/eslint",
"_phantomChildren": {},
"_requested": {
"type": "version",
"type": "tag",
"registry": true,
"raw": "eslint@4.1.0",
"raw": "eslint@latest",
"name": "eslint",
"escapedName": "eslint",
"rawSpec": "4.1.0",
"rawSpec": "latest",
"saveSpec": null,
"fetchSpec": "4.1.0"
"fetchSpec": "latest"
},
"_requiredBy": [
"#USER",
"/"
],
"_resolved": "https://registry.npmjs.org/eslint/-/eslint-4.1.0.tgz",
"_shasum": "bbb55a28220ee08b69da9554d45a6b2ebfd7d913",
"_spec": "eslint@4.1.0",
"_resolved": "https://registry.npmjs.org/eslint/-/eslint-4.1.1.tgz",
"_shasum": "facbdfcfe3e0facd3a8b80dc98c4e6c13ae582df",
"_spec": "eslint@latest",
"_where": "/Users/trott/io.js/tools/eslint-tmp",
"author": {
"name": "Nicholas C. Zakas",
Expand Down Expand Up @@ -152,5 +152,5 @@
"release": "node Makefile.js release",
"test": "node Makefile.js test"
},
"version": "4.1.0"
"version": "4.1.1"
}