diff --git a/site/theme/template/Content/MainContent.jsx b/site/theme/template/Content/MainContent.jsx
index a7dfd1f8b1..b9685b092e 100644
--- a/site/theme/template/Content/MainContent.jsx
+++ b/site/theme/template/Content/MainContent.jsx
@@ -43,7 +43,7 @@ function getModuleData(props) {
}
function fileNameToPath(filename) {
- const snippets = filename.replace(/(\/index)?((\.zh-CN)|(\.en-US))?\.md$/i, '').split('/');
+ const snippets = filename.replace(/(\/index)?((\.zh-cn)|(\.en-us))?\.md$/i, '').split('/');
return snippets[snippets.length - 1];
}
@@ -195,8 +195,10 @@ class MainContent extends Component {
if (!document.querySelector('.markdown > h2, .code-box')) {
return;
}
- require('intersection-observer'); // eslint-disable-line
- const scrollama = require('scrollama'); // eslint-disable-line
+ // eslint-disable-next-line global-require
+ require('intersection-observer');
+ // eslint-disable-next-line global-require
+ const scrollama = require('scrollama');
this.scroller = scrollama();
this.scroller
.setup({
@@ -205,7 +207,7 @@ class MainContent extends Component {
})
.onStepEnter(({ element }) => {
[].forEach.call(document.querySelectorAll('.toc-affix li a'), node => {
- node.className = ''; // eslint-disable-line
+ node.className = '';
});
const currentNode = document.querySelectorAll(`.toc-affix li a[href="#${element.id}"]`)[0];
if (currentNode) {
@@ -232,7 +234,7 @@ class MainContent extends Component {
,
];
const { disabled } = item;
- const url = item.filename.replace(/(\/index)?((\.zh-CN)|(\.en-US))?\.md$/i, '').toLowerCase();
+ const url = item.filename.replace(/(\/index)?((\.zh-cn)|(\.en-us))?\.md$/i, '').toLowerCase();
const child = !item.link ? (
- {/* eslint-disable-line */}
+
}>
diff --git a/site/theme/template/Layout/Header/index.tsx b/site/theme/template/Layout/Header/index.tsx
index d444327d03..70b9d605e1 100644
--- a/site/theme/template/Layout/Header/index.tsx
+++ b/site/theme/template/Layout/Header/index.tsx
@@ -23,7 +23,8 @@ const { Option } = Select;
let docsearch: any;
if (typeof window !== 'undefined') {
- docsearch = require('docsearch.js'); // eslint-disable-line
+ // eslint-disable-next-line global-require
+ docsearch = require('docsearch.js');
}
function initDocSearch(locale: string) {
@@ -38,8 +39,8 @@ function initDocSearch(locale: string) {
algoliaOptions: { facetFilters: [`tags:${lang}`] },
transformData(hits: { url: string }[]) {
hits.forEach(hit => {
- hit.url = hit.url.replace('ant.design', window.location.host); // eslint-disable-line
- hit.url = hit.url.replace('https:', window.location.protocol); // eslint-disable-line
+ hit.url = hit.url.replace('ant.design', window.location.host);
+ hit.url = hit.url.replace('https:', window.location.protocol)
});
return hits;
},
diff --git a/site/theme/template/utils.tsx b/site/theme/template/utils.tsx
index ebdd037a09..8bcdee1cf8 100644
--- a/site/theme/template/utils.tsx
+++ b/site/theme/template/utils.tsx
@@ -144,7 +144,6 @@ export function getLocalizedPathname(
}
export function ping(callback: (status: string) => void) {
- // eslint-disable-next-line
const url =
'https://private-a' +
'lipay' +
diff --git a/tests/dekko/dist.test.js b/tests/dekko/dist.test.js
index 0f20622993..7e118388f4 100644
--- a/tests/dekko/dist.test.js
+++ b/tests/dekko/dist.test.js
@@ -16,5 +16,5 @@ $('dist')
.hasFile('antd.compact.css')
.hasFile('dark-theme.js');
-// eslint-disable-next-line
+// eslint-disable-next-line no-console
console.log(chalk.green('✨ `dist` directory is valid.'));
diff --git a/tests/dekko/lib.test.js b/tests/dekko/lib.test.js
index 0841ffbae5..b7043ffa10 100644
--- a/tests/dekko/lib.test.js
+++ b/tests/dekko/lib.test.js
@@ -56,5 +56,5 @@ function compare(originFiles, targetFiles, targetPath) {
compare(localeFiles, localeProviderFiles, '/locale-provider');
compare(localeProviderFiles, localeFiles, '/locale');
-// eslint-disable-next-line
+// eslint-disable-next-line no-console
console.log(chalk.green('✨ `lib` directory is valid.'));
diff --git a/tests/index.test.js b/tests/index.test.js
index b86026c2ce..d42db4cf9d 100644
--- a/tests/index.test.js
+++ b/tests/index.test.js
@@ -6,7 +6,8 @@ describe('antd dist files', () => {
// https://github.com/ant-design/ant-design/issues/1638
// https://github.com/ant-design/ant-design/issues/1968
it('exports modules correctly', () => {
- const antd = testDist ? require('../dist/antd') : require('../components'); // eslint-disable-line
+ // eslint-disable-next-line global-require,import/no-unresolved
+ const antd = testDist ? require('../dist/antd') : require('../components');
expect(Object.keys(antd)).toMatchSnapshot();
});
@@ -14,7 +15,8 @@ describe('antd dist files', () => {
// https://github.com/ant-design/ant-design/issues/1804
if (testDist) {
it('should have antd.version', () => {
- const antd = require('../dist/antd'); // eslint-disable-line
+ // eslint-disable-next-line global-require,import/no-unresolved
+ const antd = require('../dist/antd');
expect(antd.version).toBe(pkg.version);
});
}