Browse Source

fix eslint config (#11701)

* fix eslint config

* use same pattern
pull/11661/merge
Heaven 6 years ago
committed by 偏右
parent
commit
debee2edcb
  1. 1
      .eslintignore
  2. 5
      .jest.js
  3. 4
      .jest.node.js
  4. 2
      package.json

1
.eslintignore

@ -4,3 +4,4 @@ components/*/__tests__/type.tsx
!.eslintrc.js
!components/*/__tests__/**/*.js
!components/*/demo/*
!.*.js

5
.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',
};

4
.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',
}
},
},
};

2
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",

Loading…
Cancel
Save