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