Skip to content

Commit

Permalink
chore: update lint rules
Browse files Browse the repository at this point in the history
  • Loading branch information
d3m1d0v committed Dec 26, 2023
1 parent 5cf59e7 commit b2bebd0
Show file tree
Hide file tree
Showing 256 changed files with 3,143 additions and 1,242 deletions.
13 changes: 11 additions & 2 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
{
"extends": ["@gravity-ui/eslint-config", "@gravity-ui/eslint-config/prettier"],
"root": true
"root": true,
"extends": [
"@gravity-ui/eslint-config",
"@gravity-ui/eslint-config/a11y",
"@gravity-ui/eslint-config/prettier",
"@gravity-ui/eslint-config/import-order"
],
"plugins": ["lodash"],
"rules": {
"lodash/import-scope": [2, "method"]
}
}
5 changes: 4 additions & 1 deletion demo/HtmlPreview.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import React from 'react';

import transform from '@diplodoc/transform';

import {MarkupString, colorClassName} from '../src';
import type {ClassNameProps} from '../src/classname';
import {colorClassName, MarkupString} from '../src';

import {plugins} from './md-plugins';

type PlaygroundHtmlPreviewProps = ClassNameProps & {
Expand Down
4 changes: 3 additions & 1 deletion demo/PMSelection.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import React from 'react';

import type {EditorView} from 'prosemirror-view';
import {isTextSelection, isNodeSelection, isWholeSelection, ClassNameProps} from '../src';

import {ClassNameProps, isNodeSelection, isTextSelection, isWholeSelection} from '../src';

export type PMSelectionProps = ClassNameProps & {
view: EditorView;
Expand Down
3 changes: 2 additions & 1 deletion demo/Playground.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from 'react';
import {ComponentMeta, Story} from '@storybook/react';

import type {ComponentMeta, Story} from '@storybook/react'; // eslint-disable-line import/no-extraneous-dependencies

import {Playground as PlaygroundComponent, PlaygroundProps} from './Playground';
import {initialMdContent} from './md-content';
Expand Down
21 changes: 11 additions & 10 deletions demo/Playground.tsx
Original file line number Diff line number Diff line change
@@ -1,32 +1,33 @@
import React from 'react';
import block from 'bem-cn-lite';
import {useUpdate} from 'react-use';

import {Button, RadioButton, TextArea} from '@gravity-ui/uikit';
import block from 'bem-cn-lite'; // eslint-disable-line import/no-extraneous-dependencies
import {useUpdate} from 'react-use';

import {
BaseNode,
BasePreset,
BehaviorPreset,
Extension,
FlexToolbar,
MarkdownBlocksPreset,
MarkdownMarksPreset,
MarkupString,
YfmEditorComponent,
useYfmEditor,
YfmPreset,
Extension,
ReactRenderStorage,
ReactRendererComponent,
FlexToolbar,
YfmEditorComponent,
YfmPreset,
logger,
useYfmEditor,
} from '../src';
import {wHiddenData, wToolbarConfig} from '../src/toolbar/config/wysiwyg';

import {PlaygroundHtmlPreview} from './HtmlPreview';
import {ProseMirrorDevTools} from './ProseMirrorDevTools';
import {PMSelection} from './PMSelection';
import {logger} from '../src/index';
import {ProseMirrorDevTools} from './ProseMirrorDevTools';
import {keys} from './keys';

import './Playground.scss';
import {keys} from './keys';

const b = block('playground');

Expand Down
3 changes: 2 additions & 1 deletion demo/ProseMirrorDevTools.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {useEffect} from 'react';
import type {EditorView} from 'prosemirror-view';

import {applyDevTools, removeDevTools} from 'prosemirror-dev-toolkit';
import type {EditorView} from 'prosemirror-view';

export type ProseMirrorDevToolsProps = {
view: EditorView;
Expand Down
31 changes: 14 additions & 17 deletions demo/md-plugins.ts
Original file line number Diff line number Diff line change
@@ -1,26 +1,23 @@
import type {PluginWithParams} from 'markdown-it/lib';

import anchors from '@diplodoc/transform/lib/plugins/anchors';
import checkbox from '@diplodoc/transform/lib/plugins/checkbox';
import code from '@diplodoc/transform/lib/plugins/code';
import cut from '@diplodoc/transform/lib/plugins/cut';
import deflist from '@diplodoc/transform/lib/plugins/deflist';
import file from '@diplodoc/transform/lib/plugins/file';
import imsize from '@diplodoc/transform/lib/plugins/imsize';

import sub from 'markdown-it-sub';
import ins from 'markdown-it-ins';
import mark from 'markdown-it-mark';
import color from 'markdown-it-color';
import math from 'markdown-it-katex';

import meta from '@diplodoc/transform/lib/plugins/meta';
import checkbox from '@diplodoc/transform/lib/plugins/checkbox';
import deflist from '@diplodoc/transform/lib/plugins/deflist';
import anchors from '@diplodoc/transform/lib/plugins/anchors';
import cut from '@diplodoc/transform/lib/plugins/cut';
import monospace from '@diplodoc/transform/lib/plugins/monospace';
import notes from '@diplodoc/transform/lib/plugins/notes';
import tabs from '@diplodoc/transform/lib/plugins/tabs';
import code from '@diplodoc/transform/lib/plugins/code';
import sup from '@diplodoc/transform/lib/plugins/sup';
import video from '@diplodoc/transform/lib/plugins/video';
import monospace from '@diplodoc/transform/lib/plugins/monospace';
import yfmTable from '@diplodoc/transform/lib/plugins/table';
import tabs from '@diplodoc/transform/lib/plugins/tabs';
import video from '@diplodoc/transform/lib/plugins/video';
import type {PluginWithParams} from 'markdown-it/lib';
import color from 'markdown-it-color';
import ins from 'markdown-it-ins';
import math from 'markdown-it-katex';
import mark from 'markdown-it-mark';
import sub from 'markdown-it-sub';

const defaultPlugins: PluginWithParams[] = [
meta,
Expand Down
6 changes: 4 additions & 2 deletions demo/utils/preview.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import React from 'react';
import type {Decorator} from '@storybook/react';
import {configure as configureUikit, ThemeProvider} from '@gravity-ui/uikit';

import {configure as configureComponents} from '@gravity-ui/components';
import {ThemeProvider, configure as configureUikit} from '@gravity-ui/uikit';
import type {Decorator} from '@storybook/react'; // eslint-disable-line import/no-extraneous-dependencies

import {configure as configureYfmEditor} from '../../src';

import '@gravity-ui/uikit/styles/styles.scss';
Expand Down
Loading

0 comments on commit b2bebd0

Please sign in to comment.