Skip to content

Commit

Permalink
chore(deps): update dependency eslint to v8 (remirror#1331)
Browse files Browse the repository at this point in the history
  • Loading branch information
ocavue authored Oct 23, 2021
1 parent 6af79df commit b6ca86b
Show file tree
Hide file tree
Showing 19 changed files with 304 additions and 303 deletions.
35 changes: 17 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@
"lint": "run-s lint:*",
"lint:build": "preconstruct validate",
"lint:css": "node support/scripts/check-styles",
"lint:es": "cross-env FULL_ESLINT_CHECK=true eslint -f codeframe --ext=.tsx,.ts,.js .",
"lint:es": "cross-env FULL_ESLINT_CHECK=true eslint -f unix --ext=.tsx,.ts,.js .",
"lint:exports": "pnpm run fix:exports -- --check",
"lint:md": "eslint -f codeframe --ignore-pattern='*.js' --ignore-pattern='*.ts' --ignore-pattern='*.tsx' .",
"lint:md": "eslint -f unix --ignore-pattern='*.js' --ignore-pattern='*.ts' --ignore-pattern='*.tsx' .",
"lint:prettier": "pnpm run:prettier -- --check",
"lint:repo": "manypkg check",
"mutate:pr": "node support/scripts/publish-pr",
Expand Down Expand Up @@ -151,15 +151,15 @@
"@testing-library/jest-dom": "^5.14.1",
"@testing-library/react-hooks": "^7.0.1",
"@testing-library/user-event": "^13.2.0",
"@types/eslint": "^7.2.13",
"@types/eslint": "^7.28.2",
"@types/jest": "^27.0.0",
"@types/jest-axe": "^3.5.2",
"@types/ms.macro": "^2.0.0",
"@types/node": "^16.3.3",
"@types/requestidlecallback": "^0.3.4",
"@types/testing-library__jest-dom": "^5.14.0",
"@typescript-eslint/eslint-plugin": "^4.28.3",
"@typescript-eslint/parser": "^4.28.3",
"@typescript-eslint/eslint-plugin": "^5.1.0",
"@typescript-eslint/parser": "^5.1.0",
"aws-cdk": "^1.114.0",
"babel-jest": "^27.0.6",
"babel-plugin-dev-expression": "^0.2.2",
Expand All @@ -177,24 +177,24 @@
"delay": "^5.0.0",
"doc-plugin-remirror": "^0.2.1",
"downlevel-dts": "^0.7.0",
"eslint": "^7.30.0",
"eslint-config-prettier": "^8.2.0",
"eslint": "^8.1.0",
"eslint-config-prettier": "^8.3.0",
"eslint-formatter-github": "^1.0.11",
"eslint-plugin-eslint-comments": "^3.2.0",
"eslint-plugin-graphql": "^4.0.0",
"eslint-plugin-import": "^2.23.4",
"eslint-plugin-jest": "^24.3.5",
"eslint-plugin-import": "^2.25.2",
"eslint-plugin-jest": "^25.2.2",
"eslint-plugin-jest-formatting": "^3.0.0",
"eslint-plugin-jsx-a11y": "^6.4.1",
"eslint-plugin-lit": "^1.5.1",
"eslint-plugin-lit-a11y": "^1.0.1",
"eslint-plugin-markdown": "^2.2.0",
"eslint-plugin-promise": "^5.1.0",
"eslint-plugin-react": "^7.24.0",
"eslint-plugin-lit": "^1.6.1",
"eslint-plugin-lit-a11y": "^2.1.0",
"eslint-plugin-markdown": "^2.2.1",
"eslint-plugin-promise": "^5.1.1",
"eslint-plugin-react": "^7.26.1",
"eslint-plugin-react-hooks": "^4.2.0",
"eslint-plugin-react-native": "^3.11.0",
"eslint-plugin-simple-import-sort": "^7.0.0",
"eslint-plugin-unicorn": "^35.0.0",
"eslint-plugin-unicorn": "^37.0.1",
"esm": "^3.2.25",
"expect-playwright": "^0.7.2",
"husky": "^7.0.1",
Expand Down Expand Up @@ -238,9 +238,8 @@
"pnpm": {
"overrides": {
"@babel/preset-env": "^7.13.10",
"monaco-editor": "npm:@typescript-deploys/[email protected]",
"postcss": ">=8",
"typescript": "^4.3.5"
"eslint-plugin-react-hooks": "4.2.1-alpha-3c4c1c470-20211021",
"postcss": ">=8"
}
},
"preconstruct": {
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-prosemirror/src/jest-prosemirror-editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ export function insertText<Schema extends EditorSchema = EditorSchema>(

let pos = start;

text.split('').forEach((character) => {
[...text].forEach((character) => {
keys.char({ text: character, typing: true });

if (!view.someProp('handleTextInput', (f) => f(view, pos, pos, character))) {
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-prosemirror/src/jest-prosemirror-matchers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { apply } from './jest-prosemirror-editor';
import { transformsNodeFailMessage, transformsNodePassMessage } from './jest-prosemirror-messages';
import type { CommandTransformation } from './jest-prosemirror-types';

export const prosemirrorMatchers = {
export const prosemirrorMatchers: jest.ExpectExtendMap = {
toTransformNode(
this: jest.MatcherUtils,
command: ProsemirrorCommandFunction,
Expand Down
2 changes: 1 addition & 1 deletion packages/multishift/src/multishift-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ export type ActionCreatorMapToDispatch<CreatorMap extends ActionCreatorsMapObjec
/**
* Infers Action union-type from action-creator map object
*/
type ActionType<ActionCreatorMap extends any> = ActionCreatorMap extends ActionCreator<any>
type ActionType<ActionCreatorMap> = ActionCreatorMap extends ActionCreator<any>
? ReturnType<ActionCreatorMap>
: ActionCreatorMap extends Record<any, any>
? {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ describe('findChildren', () => {
expect(result).toHaveLength(3);

result.forEach((item) => {
expect(item.node.type.name).toEqual('paragraph');
expect(item.node.type.name).toBe('paragraph');
});
});

Expand All @@ -50,7 +50,7 @@ describe('findChildren', () => {
expect(mock).toHaveBeenCalledTimes(3);

mock.mock.calls.forEach(([item]) => {
expect(item.node.type.name).toEqual('paragraph');
expect(item.node.type.name).toBe('paragraph');
});
});

Expand Down Expand Up @@ -136,7 +136,7 @@ describe('findChildrenByAttribute', () => {
expect(result).toHaveLength(2);

result.forEach((item) => {
expect(item.node.attrs.colspan).toEqual(2);
expect(item.node.attrs.colspan).toBe(2);
});
});

Expand Down Expand Up @@ -173,7 +173,7 @@ describe('findChildrenByNode', () => {
expect(result).toHaveLength(3);

result.forEach((item) => {
expect(item.node.type.name).toEqual('table_cell');
expect(item.node.type.name).toBe('table_cell');
});
});
});
Expand All @@ -195,7 +195,7 @@ describe('findChildrenByMark', () => {
expect(result).toHaveLength(2);

result.forEach((item) => {
expect(item.node.marks[0]?.type.name).toEqual('strong');
expect(item.node.marks[0]?.type.name).toBe('strong');
});
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,15 +236,15 @@ describe('findElementAtPosition', () => {
const reference = findElementAtPosition(6, view);

expect(reference instanceof HTMLDivElement).toBe(true);
expect(reference.getAttribute('data-node-type')).toEqual('atomBlock');
expect(reference.getAttribute('data-node-type')).toBe('atomBlock');
});

it('should return DOM reference of a nested inline leaf node', () => {
const { view } = createEditor(doc(p('one', atomInline(), 'two')));
const reference = findElementAtPosition(4, view);

expect(reference instanceof HTMLSpanElement).toBe(true);
expect(reference.getAttribute('data-node-type')).toEqual('atomInline');
expect(reference.getAttribute('data-node-type')).toBe('atomInline');
});

it('should return DOM reference of a content block node', () => {
Expand Down Expand Up @@ -374,7 +374,7 @@ describe('findParentNode', () => {
selection,
});

expect(result?.node.type.name).toEqual('table');
expect(result?.node.type.name).toBe('table');
});

it('returns `undefined` when no parent node found', () => {
Expand Down Expand Up @@ -511,7 +511,7 @@ describe('findSelectedNodeOfType', () => {
selection: tr.selection,
});

expect(selectedNode!.node.type.name).toEqual('paragraph');
expect(selectedNode!.node.type.name).toBe('paragraph');
});

it('should return selected node of one of the given `nodeType`s', () => {
Expand All @@ -522,7 +522,7 @@ describe('findSelectedNodeOfType', () => {
selection: state.selection,
});

expect(selectedNode?.node.type.name).toEqual('paragraph');
expect(selectedNode?.node.type.name).toBe('paragraph');
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,11 +241,11 @@ describe('plugin#apply', () => {
commands.addAnnotation({ id: '1' });

// Pre-condition
expect(helpers.getAnnotations()[0]?.text).toEqual('Hello');
expect(helpers.getAnnotations()[0]?.text).toBe('Hello');

commands.insertText('ADDED', { from: 3 });

expect(helpers.getAnnotations()[0]?.text).toEqual('HeADDEDllo');
expect(helpers.getAnnotations()[0]?.text).toBe('HeADDEDllo');
});

it("doesn't extend annotation when content is added at the end of an annotation", () => {
Expand All @@ -260,11 +260,11 @@ describe('plugin#apply', () => {
commands.addAnnotation({ id: '1' });

// Pre-condition
expect(helpers.getAnnotations()[0]?.text).toEqual('Hello');
expect(helpers.getAnnotations()[0]?.text).toBe('Hello');

commands.insertText('ADDED', { from: 6 });

expect(helpers.getAnnotations()[0]?.text).toEqual('Hello');
expect(helpers.getAnnotations()[0]?.text).toBe('Hello');
});
});

Expand Down Expand Up @@ -354,7 +354,7 @@ describe('helpers', () => {
},
]);

expect(helpers.getAnnotations()[0]?.text).toEqual('Hello<NEWLINE>World');
expect(helpers.getAnnotations()[0]?.text).toBe('Hello<NEWLINE>World');
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ describe('constructor', () => {
it('is created with the correct default properties and settings', () => {
const codeBlock = new CodeBlockExtension({ syntaxTheme: 'a11y_dark' });

expect(codeBlock.options.syntaxTheme).toEqual('a11y_dark');
expect(codeBlock.options.defaultLanguage).toEqual('markup');
expect(codeBlock.options.plainTextClassName).toEqual('');
expect(codeBlock.options.syntaxTheme).toBe('a11y_dark');
expect(codeBlock.options.defaultLanguage).toBe('markup');
expect(codeBlock.options.plainTextClassName).toBe('');
});
});

Expand Down Expand Up @@ -435,23 +435,23 @@ describe('language', () => {

it('yaml', () => {
// Just here to make sure it's not undefined
expect(yaml.name).toEqual('yaml');
expect(yaml.aliases[0]).toEqual('yml');
expect(yaml.name).toBe('yaml');
expect(yaml.aliases[0]).toBe('yml');
expect(getLang('yaml')).toEqual(yaml.name);
expect(getLang('yml')).toEqual(yaml.aliases[0]);
expect(getLang('YAML')).toEqual(yaml.name);
expect(getLang('YML')).toEqual(yaml.aliases[0]);
});

it('graphql', () => {
expect(graphql.name).toEqual('graphql');
expect(graphql.name).toBe('graphql');
expect(getLang('graphql')).toEqual(graphql.name);
expect(getLang('GraphQL')).toEqual(graphql.name);
expect(getLang('GRAPHQL')).toEqual(graphql.name);
});

it('handles unknown', () => {
expect(getLang(`this_language_does_not_exist`)).toEqual('');
expect(getLang(`this_language_does_not_exist`)).toBe('');
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,10 +178,10 @@ describe('commands', () => {

it('updates the language', () => {
add(doc(jsBlock())).callback((content) => {
expect(getCodeMirrorMode(dom)).toEqual('javascript');
expect(getCodeMirrorMode(dom)).toBe('javascript');

content.commands.updateCodeMirror({ language: 'python' });
expect(getCodeMirrorMode(dom)).toEqual('python');
expect(getCodeMirrorMode(dom)).toBe('python');
});
});
});
Expand Down
58 changes: 29 additions & 29 deletions packages/remirror__extension-list/__tests__/list-commands.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -464,12 +464,12 @@ describe('calculateItemRange', () => {
),
);
const range = calculateItemRange(editor.state.selection)!;
expect(range.depth).toEqual(1);
expect(range.parent.type.name).toEqual('bulletList');
expect(range.startIndex).toEqual(0);
expect(range.endIndex).toEqual(1);
expect(editor.doc.resolve(range.start).node().type.name).toEqual('bulletList');
expect(editor.doc.resolve(range.end).node().type.name).toEqual('bulletList');
expect(range.depth).toBe(1);
expect(range.parent.type.name).toBe('bulletList');
expect(range.startIndex).toBe(0);
expect(range.endIndex).toBe(1);
expect(editor.doc.resolve(range.start).node().type.name).toBe('bulletList');
expect(editor.doc.resolve(range.end).node().type.name).toBe('bulletList');
});

it('returns correct range when the selection is not empty', () => {
Expand All @@ -483,17 +483,17 @@ describe('calculateItemRange', () => {
),
);
const range = calculateItemRange(editor.state.selection)!;
expect(range.depth).toEqual(1);
expect(range.parent.type.name).toEqual('taskList');
expect(range.startIndex).toEqual(1);
expect(range.endIndex).toEqual(3);
expect(range.depth).toBe(1);
expect(range.parent.type.name).toBe('taskList');
expect(range.startIndex).toBe(1);
expect(range.endIndex).toBe(3);

const { start, end } = range;
expect(editor.doc.resolve(start).node().type.name).toEqual('taskList');
expect(editor.doc.resolve(end).node().type.name).toEqual('taskList');
expect(editor.doc.resolve(start).node().type.name).toBe('taskList');
expect(editor.doc.resolve(end).node().type.name).toBe('taskList');

expect(editor.doc.resolve(start).nodeAfter?.type.name).toEqual('taskListItem');
expect(editor.doc.resolve(end).nodeBefore?.type.name).toEqual('taskListItem');
expect(editor.doc.resolve(start).nodeAfter?.type.name).toBe('taskListItem');
expect(editor.doc.resolve(end).nodeBefore?.type.name).toBe('taskListItem');
});

it('returns correct range when the selection is in a deep list', () => {
Expand All @@ -515,17 +515,17 @@ describe('calculateItemRange', () => {
),
);
const range = calculateItemRange(editor.state.selection)!;
expect(range.depth).toEqual(3);
expect(range.parent.type.name).toEqual('orderedList');
expect(range.startIndex).toEqual(1);
expect(range.endIndex).toEqual(4);
expect(editor.doc.resolve(range.start).node().type.name).toEqual('orderedList');
expect(editor.doc.resolve(range.end).node().type.name).toEqual('orderedList');
expect(range.depth).toBe(3);
expect(range.parent.type.name).toBe('orderedList');
expect(range.startIndex).toBe(1);
expect(range.endIndex).toBe(4);
expect(editor.doc.resolve(range.start).node().type.name).toBe('orderedList');
expect(editor.doc.resolve(range.end).node().type.name).toBe('orderedList');

const slice = editor.doc.slice(range.start, range.end);
expect(slice.openStart).toEqual(0);
expect(slice.openEnd).toEqual(0);
expect(slice.content.childCount).toEqual(3);
expect(slice.openStart).toBe(0);
expect(slice.openEnd).toBe(0);
expect(slice.content.childCount).toBe(3);
});

it('returns correct range when the selection across different levels', () => {
Expand All @@ -547,12 +547,12 @@ describe('calculateItemRange', () => {
),
);
const range = calculateItemRange(editor.state.selection)!;
expect(range.depth).toEqual(1);
expect(range.parent.type.name).toEqual('bulletList');
expect(range.startIndex).toEqual(1);
expect(range.endIndex).toEqual(2);
expect(editor.doc.resolve(range.start).node().type.name).toEqual('bulletList');
expect(editor.doc.resolve(range.end).node().type.name).toEqual('bulletList');
expect(range.depth).toBe(1);
expect(range.parent.type.name).toBe('bulletList');
expect(range.startIndex).toBe(1);
expect(range.endIndex).toBe(2);
expect(editor.doc.resolve(range.start).node().type.name).toBe('bulletList');
expect(editor.doc.resolve(range.end).node().type.name).toBe('bulletList');
});

it('returns nothing when the selection is not in a list', () => {
Expand Down
Loading

0 comments on commit b6ca86b

Please sign in to comment.