Skip to content

Commit

Permalink
tools: remove eslint in tools
Browse files Browse the repository at this point in the history
  • Loading branch information
gengjiawen committed Feb 19, 2019
1 parent 0fecaca commit be9743d
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 66 deletions.
4 changes: 1 addition & 3 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ NodePlugin.RULES_DIR = path.resolve(__dirname, 'tools', 'eslint-rules');

const ModuleFindPath = Module._findPath;
const hacks = [
'eslint-plugin-node-core',
'eslint-plugin-markdown',
'babel-eslint',
'eslint-plugin-node-core'
];
Module._findPath = (request, paths, isMain) => {
const r = ModuleFindPath(request, paths, isMain);
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -135,3 +135,5 @@ deps/v8/gypfiles/Release/
deps/v8/third_party/eu-strip/

.DS_Store
tools/node_modules/*
node_modules/*
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -705,6 +705,7 @@ out/doc/api/assets/%: doc/api_assets/% out/doc/api/assets


run-npm-ci = $(PWD)/$(NPM) ci
run-npm-task = $(PWD)/$(NPM) run

LINK_DATA = out/doc/apilinks.json
gen-api = tools/doc/generate.js --node-version=$(FULLVERSION) \
Expand Down Expand Up @@ -1172,8 +1173,7 @@ lint-md: | tools/.mdlintstamp

LINT_JS_TARGETS = .eslintrc.js benchmark doc lib test tools

run-lint-js = tools/node_modules/eslint/bin/eslint.js --cache \
--report-unused-disable-directives --ext=.js,.mjs,.md $(LINT_JS_TARGETS)
run-lint-js = $(call available-node,$(run-npm-ci)) && $(call available-node,$(run-npm-task) lint)
run-lint-js-fix = $(run-lint-js) --fix

.PHONY: lint-js-fix
Expand Down
17 changes: 17 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "node-core",
"author": "The Amazing Node.js Contributors",
"version": "1.0.0",
"description": "Base tools to help manage node core",
"license": "MIT",
"scripts": {
"lint": "eslint --cache --report-unused-disable-directives --ext=.js,.mjs,.md .eslintrc.js benchmark doc lib test tools"
},
"dependencies": {
"babel-eslint": "8.2.1",
"eslint": "5.14.1",
"eslint-plugin-markdown": "1.0.0",
"glob": "7.1.3",
"js-yaml": "3.12.1"
}
}
3 changes: 1 addition & 2 deletions tools/doc/common.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
'use strict';

const yaml =
require(`${__dirname}/../node_modules/eslint/node_modules/js-yaml`);
const yaml = require(`js-yaml`);

function isYAMLBlock(text) {
return /^<!-- YAML/.test(text);
Expand Down
2 changes: 1 addition & 1 deletion tools/lint-js.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const fs = require('fs');
const totalCPUs = require('os').cpus().length;

const CLIEngine = require('eslint').CLIEngine;
const glob = require('eslint/node_modules/glob');
const glob = require('glob');

const cliOptions = {
rulePaths: rulesDirs,
Expand Down
26 changes: 0 additions & 26 deletions tools/update-babel-eslint.sh

This file was deleted.

30 changes: 0 additions & 30 deletions tools/update-eslint.sh

This file was deleted.

4 changes: 2 additions & 2 deletions vcbuild.bat
Original file line number Diff line number Diff line change
Expand Up @@ -626,9 +626,9 @@ goto exit
:lint-js
if defined lint_js_ci goto lint-js-ci
if not defined lint_js goto lint-md-build
if not exist tools\node_modules\eslint goto no-lint
echo running lint-js
%config%\node tools\node_modules\eslint\bin\eslint.js --cache --report-unused-disable-directives --rule "linebreak-style: 0" --ext=.js,.mjs,.md .eslintrc.js benchmark doc lib test tools
%npm_exe% install
%npm_exe% run lint
goto lint-md-build

:lint-js-ci
Expand Down

0 comments on commit be9743d

Please sign in to comment.