mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-27 12:39:49 +08:00
chore: add lodash eslint (#45627)
This commit is contained in:
parent
300c1f3f79
commit
923aaba047
12
.eslintrc.js
12
.eslintrc.js
@ -25,7 +25,16 @@ module.exports = {
|
||||
},
|
||||
},
|
||||
parser: '@typescript-eslint/parser',
|
||||
plugins: ['react', '@babel', 'jest', '@typescript-eslint', 'react-hooks', 'unicorn', 'markdown'],
|
||||
plugins: [
|
||||
'react',
|
||||
'@babel',
|
||||
'jest',
|
||||
'@typescript-eslint',
|
||||
'react-hooks',
|
||||
'unicorn',
|
||||
'markdown',
|
||||
'lodash',
|
||||
],
|
||||
// https://github.com/typescript-eslint/typescript-eslint/issues/46#issuecomment-470486034
|
||||
overrides: [
|
||||
{
|
||||
@ -156,6 +165,7 @@ module.exports = {
|
||||
'react/no-unused-class-component-methods': 0,
|
||||
'import/extensions': 0,
|
||||
'import/no-cycle': 2,
|
||||
'lodash/import-scope': 2,
|
||||
'import/no-extraneous-dependencies': [
|
||||
'error',
|
||||
{
|
||||
|
@ -1,10 +1,11 @@
|
||||
import { kebabCase } from 'lodash';
|
||||
import canUseDom from 'rc-util/lib/Dom/canUseDom';
|
||||
import React from 'react';
|
||||
import kebabCase from 'lodash/kebabCase';
|
||||
import canUseDom from 'rc-util/lib/Dom/canUseDom';
|
||||
|
||||
import ConfigProvider from '..';
|
||||
import { InputNumber } from '../..';
|
||||
import { render } from '../../../tests/utils';
|
||||
import { resetWarned } from '../../_util/warning';
|
||||
import { render } from '../../../tests/utils';
|
||||
import theme from '../../theme';
|
||||
import { useToken } from '../../theme/internal';
|
||||
|
||||
|
@ -1,9 +1,8 @@
|
||||
import React from 'react';
|
||||
import { uniqueId } from 'lodash';
|
||||
|
||||
import { createStyles, css } from 'antd-style';
|
||||
import { AlertFilled, CloseSquareFilled } from '@ant-design/icons';
|
||||
import { Button, Form, Input, Tooltip } from 'antd';
|
||||
import { createStyles, css } from 'antd-style';
|
||||
import uniqueId from 'lodash/uniqueId';
|
||||
|
||||
const useStyle = createStyles(() => ({
|
||||
'custom-feedback-icons': css`
|
||||
|
@ -1,13 +1,14 @@
|
||||
import { produce } from 'immer';
|
||||
import { cloneDeep } from 'lodash';
|
||||
import type { UploadRequestOption } from 'rc-upload/lib/interface';
|
||||
import React, { useEffect, useRef } from 'react';
|
||||
import { produce } from 'immer';
|
||||
import cloneDeep from 'lodash/cloneDeep';
|
||||
import type { UploadRequestOption } from 'rc-upload/lib/interface';
|
||||
|
||||
import type { RcFile, UploadFile, UploadProps } from '..';
|
||||
import Upload from '..';
|
||||
import { resetWarned } from '../../_util/warning';
|
||||
import mountTest from '../../../tests/shared/mountTest';
|
||||
import rtlTest from '../../../tests/shared/rtlTest';
|
||||
import { act, fireEvent, render, waitFakeTimer } from '../../../tests/utils';
|
||||
import { resetWarned } from '../../_util/warning';
|
||||
import Form from '../../form';
|
||||
import { getFileItem, isImageUrl, removeFileItem } from '../utils';
|
||||
import { setup, teardown } from './mock';
|
||||
|
@ -232,6 +232,7 @@
|
||||
"eslint-plugin-import": "^2.28.0",
|
||||
"eslint-plugin-jest": "^27.0.1",
|
||||
"eslint-plugin-jsx-a11y": "^6.2.1",
|
||||
"eslint-plugin-lodash": "^7.4.0",
|
||||
"eslint-plugin-markdown": "^3.0.0",
|
||||
"eslint-plugin-react": "^7.31.8",
|
||||
"eslint-plugin-react-hooks": "^4.1.2",
|
||||
|
@ -1,6 +1,8 @@
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
import _ from 'lodash';
|
||||
import remove from 'lodash/remove';
|
||||
import sortBy from 'lodash/sortBy';
|
||||
import unionBy from 'lodash/unionBy';
|
||||
import simpleGit from 'simple-git';
|
||||
|
||||
const cwd = process.cwd();
|
||||
@ -18,7 +20,7 @@ const excludes = [
|
||||
|
||||
async function execute() {
|
||||
let { all } = await git.log();
|
||||
all = _.remove(all, ({ author_email: email }) => {
|
||||
all = remove(all, ({ author_email: email }) => {
|
||||
for (let i = 0; i < excludes.length; i++) {
|
||||
const item = excludes[i];
|
||||
if (email.includes(item)) {
|
||||
@ -28,7 +30,7 @@ async function execute() {
|
||||
return true;
|
||||
});
|
||||
|
||||
all = _.sortBy(_.unionBy(all, 'author_email'), 'author_name');
|
||||
all = sortBy(unionBy(all, 'author_email'), 'author_name');
|
||||
|
||||
fs.writeFileSync(
|
||||
path.join(cwd, 'contributors.json'),
|
||||
|
@ -1,15 +1,16 @@
|
||||
/* eslint-disable react/jsx-no-constructed-context-values */
|
||||
import path from 'path';
|
||||
import * as React from 'react';
|
||||
import { createCache, StyleProvider } from '@ant-design/cssinjs';
|
||||
import { globSync } from 'glob';
|
||||
import * as React from 'react';
|
||||
import kebabCase from 'lodash/kebabCase';
|
||||
import { renderToString } from 'react-dom/server';
|
||||
import { kebabCase } from 'lodash';
|
||||
|
||||
import { resetWarned } from '../../components/_util/warning';
|
||||
import { render } from '../utils';
|
||||
import { TriggerMockContext } from './demoTestContext';
|
||||
import { excludeWarning, isSafeWarning } from './excludeWarning';
|
||||
import rootPropsTest from './rootPropsTest';
|
||||
import { resetWarned } from '../../components/_util/warning';
|
||||
|
||||
export { rootPropsTest };
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user