Skip to content

Commit

Permalink
chore: Fix lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
3y3 committed Aug 13, 2024
1 parent 38fa0ef commit 983df31
Show file tree
Hide file tree
Showing 21 changed files with 873 additions and 336 deletions.
6 changes: 6 additions & 0 deletions __tests__/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
parserOptions: {
tsconfigRootDir: __dirname,
project: ['./tsconfig.json'],
},
};
1 change: 1 addition & 0 deletions __tests__/lenses.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {lensIndex, view} from 'ramda';

import {first, second} from '../src/lenses';

describe('first', () => {
Expand Down
29 changes: 14 additions & 15 deletions __tests__/parsers.ts
Original file line number Diff line number Diff line change
@@ -1,33 +1,32 @@
/* eslint-disable @typescript-eslint/no-shadow */
import {compose, map, reduce, split, filter, not, equals, and, or} from 'ramda';
import {and, compose, equals, filter, map, not, or, reduce, split} from 'ramda';

import {
SENTENCE_END_MARKERS,
BRACKETS_CLOSE_MARKERS,
QUOTATION_GENERIC_MARKERS,
QUOTATION_CLOSE_MARKERS,
QUOTATION_GENERIC_MARKERS,
SENTENCE_END_MARKERS,
} from '../src/constants';

import {
fst,
snd,
sentences,
words,
bracketsClosePrefix,
delimiterPrefix,
delimiters,
dotSuffix,
fst,
fstChars,
fstToken,
fstWord,
lstChars,
lstToken,
lstWord,
fstChars,
lstChars,
quotationClosePrefix,
quotationGenericPrefix,
sentences,
snd,
spacePrefix,
spaceSuffix,
quotationGenericPrefix,
quotationClosePrefix,
delimiterPrefix,
bracketsClosePrefix,
spaces,
dotSuffix,
words,
} from '../src/parsers';

describe('fst', () => {
Expand Down
31 changes: 15 additions & 16 deletions __tests__/rules/abbreviations.ts
Original file line number Diff line number Diff line change
@@ -1,34 +1,33 @@
/* eslint-disable @typescript-eslint/no-shadow */
import {
and,
compose,
map,
reduce,
keys,
toUpper,
split,
concat,
flip,
unnest,
juxt,
and,
keys,
map,
or,
reduce,
split,
toUpper,
unnest,
} from 'ramda';

import {leftAbbreviation, pairAbbreviation, leftPairsTailAbbreviation} from '../../src/rules';
import {leftAbbreviation, leftPairsTailAbbreviation, pairAbbreviation} from '../../src/rules';
import {
INITIALS,
HEAD,
TAIL,
OTHER,
HEAD_PAIR,
TAIL_PAIR,
INITIALS,
OTHER,
OTHER_PAIR,
TAIL,
TAIL_PAIR,
} from '../../src/constants/abbreviations';

const pairWith =
(a: string) =>
(b: string): [string, string] =>
[b, a];
(b: string): [string, string] => [b, a];

const keysWithRightFirstUpper = map(compose(pairWith(' С заглавной'), flip(concat)('.')));
const keysSpacesWithRightFirstUpper = map(compose(pairWith(' С заглавной'), flip(concat)('. ')));
Expand Down Expand Up @@ -123,11 +122,11 @@ describe('pairAbbreviation', () => {
});

describe('leftPairsTailAbbreviation', () => {
const test = (expected: boolean) => (pair: string[]) => {
const test = (expected: boolean) => (pair: string[]) => {
it('handles "' + pair.join('') + '"', () => {
expect(leftPairsTailAbbreviation(pair)).toBe(expected);
});
}
};

const generateInput = compose(
unnest,
Expand Down
39 changes: 19 additions & 20 deletions __tests__/rules/base.ts
Original file line number Diff line number Diff line change
@@ -1,36 +1,35 @@
import {
compose,
map,
reduce,
zip,
juxt,
or,
always,
and,
split,
join,
compose,
concat,
always,
equals,
filter,
join,
juxt,
map,
not,
equals,
or,
reduce,
split,
zip,
} from 'ramda';

import {
SENTENCE_END_MARKERS,
QUOTATION_GENERIC_MARKERS,
QUOTATION_CLOSE_MARKERS,
BRACKETS_CLOSE_MARKERS,
QUOTATION_CLOSE_MARKERS,
QUOTATION_GENERIC_MARKERS,
SENTENCE_END_MARKERS,
} from '../../src/constants';

import {
spaceBothSides,
rightLacksSpacePrefix,
rightStartsWithLowercase,
rightDelimiterPrefix,
rightQuotationGenericPrefix,
rightQuotationClosePrefix,
rightBracketsClosePrefix,
rightDelimiterPrefix,
rightLacksSpacePrefix,
rightOnlySpaces,
rightQuotationClosePrefix,
rightQuotationGenericPrefix,
rightStartsWithLowercase,
spaceBothSides,
} from '../../src/rules';

describe('spaceBothSides', () => {
Expand Down
3 changes: 2 additions & 1 deletion __tests__/rules/initials.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {compose, map, reduce, and, or} from 'ramda';
import {and, compose, map, or, reduce} from 'ramda';

import {leftInitials} from '../../src/rules';

describe('leftInitials', () => {
Expand Down
11 changes: 11 additions & 0 deletions __tests__/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"extends": "@diplodoc/tsconfig",
"compilerOptions": {
"lib": ["ES2019"],
"target": "es6",
"baseUrl": ".",
"rootDir": "src",
"outDir": "lib/",
"module": "CommonJS"
}
}
10 changes: 5 additions & 5 deletions __tests__/utilities.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import {compose, map, reduce, split, and, or} from 'ramda';
import {and, compose, map, or, reduce, split} from 'ramda';

import {
lenLte,
allEqual,
lengthNonZero,
charAt,
notAlpha,
startsWithLower,
hasAlpha,
isUpper,
lenLte,
lengthNonZero,
notAlpha,
startsWithLower,
} from '../src/utilities';

describe('lenLte', () => {
Expand Down
4 changes: 4 additions & 0 deletions esbuild/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
extends: require.resolve('@diplodoc/lint/eslint-config/node'),
root: true,
};
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 983df31

Please sign in to comment.