From debee2edcbb42ce1ef5b808dad9c3ec8e8740578 Mon Sep 17 00:00:00 2001 From: Heaven Date: Fri, 10 Aug 2018 13:49:06 +0800 Subject: [PATCH] fix eslint config (#11701) * fix eslint config * use same pattern --- .eslintignore | 1 + .jest.js | 5 ++--- .jest.node.js | 4 ++-- package.json | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.eslintignore b/.eslintignore index bb7762f79f..7788b5b46c 100644 --- a/.eslintignore +++ b/.eslintignore @@ -4,3 +4,4 @@ components/*/__tests__/type.tsx !.eslintrc.js !components/*/__tests__/**/*.js !components/*/demo/* +!.*.js diff --git a/.jest.js b/.jest.js index 662503bb6c..e134a6f190 100644 --- a/.jest.js +++ b/.jest.js @@ -2,12 +2,11 @@ const libDir = process.env.LIB_DIR; const transformIgnorePatterns = [ '/dist/', - 'node_modules\/[^/]+?\/(?!(es|node_modules)\/)', // Ignore modules without es dir + 'node_modules/[^/]+?/(?!(es|node_modules)/)', // Ignore modules without es dir ]; module.exports = { verbose: true, - testURL: "http://localhost/", setupFiles: [ './tests/setup.js', ], @@ -48,7 +47,7 @@ module.exports = { globals: { 'ts-jest': { tsConfigFile: './tsconfig.test.json', - } + }, }, testURL: 'http://localhost', }; diff --git a/.jest.node.js b/.jest.node.js index df22d8c029..c66c206ef6 100644 --- a/.jest.node.js +++ b/.jest.node.js @@ -16,11 +16,11 @@ module.exports = { testRegex: 'demo\\.test\\.js$', testEnvironment: 'node', snapshotSerializers: [ - 'enzyme-to-json/serializer' + 'enzyme-to-json/serializer', ], globals: { 'ts-jest': { tsConfigFile: './tsconfig.test.json', - } + }, }, }; diff --git a/package.json b/package.json index 2af3511fcf..643bcfd5ce 100644 --- a/package.json +++ b/package.json @@ -187,7 +187,7 @@ "test-all": "./scripts/test-all.sh", "lint": "npm run lint:ts && npm run lint:es && npm run lint:demo && npm run lint:style", "lint:ts": "npm run tsc && antd-tools run ts-lint", - "lint:es": "eslint tests site scripts components ./.eslintrc.js ./webpack.config.js --ext '.js,.jsx'", + "lint:es": "eslint tests site scripts components ./.*.js ./webpack.config.js --ext '.js,.jsx'", "lint:demo": "cross-env RUN_ENV=DEMO eslint components/*/demo/*.md --ext '.md'", "lint:style": "stylelint \"{site,components}/**/*.less\" --syntax less", "lint-fix:ts": "npm run tsc && antd-tools run ts-lint-fix",