Skip to content

Commit f0b9a39

Browse files
authored
Merge pull request #68 from github/feat-add-no-shadow-to-recommended-rules
feat: add no-shadow to recommended rules
2 parents 07d77d2 + 4f7207c commit f0b9a39

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

bin/flow-coverage.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
const childProcess = require('child_process')
77
const flow = require('flow-bin')
88
const fs = require('fs')
9-
const path = require('path')
9+
const {join} = require('path')
1010

1111
const execFile = (file, args) =>
1212
new Promise((resolve, reject) => {
@@ -86,7 +86,7 @@ async function grepFlowFiles() {
8686
;(async function() {
8787
let threshold = 0
8888

89-
const packageJsonPath = path.join(process.cwd(), 'package.json')
89+
const packageJsonPath = join(process.cwd(), 'package.json')
9090
if (fs.existsSync(packageJsonPath)) {
9191
const packageJson = require(packageJsonPath)
9292
threshold = (packageJson.flow && packageJson.flow.coverageThreshold) || 0

lib/configs/recommended.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ module.exports = {
5555
'no-regex-spaces': 'error',
5656
'no-return-assign': 'error',
5757
'no-self-assign': 'error',
58+
'no-shadow': 'error',
5859
'no-sparse-arrays': 'error',
5960
'no-this-before-super': 'error',
6061
'no-throw-literal': 'error',

lib/rules/dependency-graph.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ module.exports = {
1919

2020
checkEntriesWhitelist(filename)
2121

22-
function recordImport(filename, symbol) {
23-
let symbols = imports.get(filename)
22+
function recordImport(importPath, symbol) {
23+
let symbols = imports.get(importPath)
2424
if (!symbols) {
2525
symbols = new Set()
26-
imports.set(filename, symbols)
26+
imports.set(importPath, symbols)
2727
}
2828

2929
if (symbol) {

0 commit comments

Comments
 (0)