@tinkoff/eslint-config 1.54.4 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/internal/typescript.js +1 -1
- package/package.json +16 -13
- package/test/import/import-happy.test.js +6 -6
- package/test/import/import-unhappy.test.js +6 -6
- package/test/index.test.js +11 -11
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,21 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [2.0.0](https://github.com/tramvaijs/linters/compare/v1.54.4...v2.0.0) (2023-11-07)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### ⚠ BREAKING CHANGES
|
|
10
|
+
|
|
11
|
+
* switch to ESLint v8
|
|
12
|
+
|
|
13
|
+
Please fix errors and warnings.
|
|
14
|
+
|
|
15
|
+
### Features
|
|
16
|
+
|
|
17
|
+
* switch to ESLint v8 ([31e95e3](https://github.com/tramvaijs/linters/commit/31e95e3464b229710cc3fa8822ec988a8d9cbc16))
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
6
21
|
### [1.54.4](https://github.com/tramvaijs/linters/compare/v1.54.3...v1.54.4) (2023-09-25)
|
|
7
22
|
|
|
8
23
|
|
package/internal/typescript.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tinkoff/eslint-config",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "ESLint configs to rule them all",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"keywords": [
|
|
@@ -15,25 +15,28 @@
|
|
|
15
15
|
"url": "https://github.com/tramvaijs/linters.git"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@babel/eslint-parser": "^7.
|
|
18
|
+
"@babel/eslint-parser": "^7.21.3",
|
|
19
19
|
"@babel/eslint-plugin": "^7.19.1",
|
|
20
20
|
"@typescript-eslint/eslint-plugin": "^6.7.2",
|
|
21
21
|
"@typescript-eslint/parser": "^6.7.2",
|
|
22
|
-
"eslint": "^
|
|
23
|
-
"eslint-config-airbnb-base": "^
|
|
24
|
-
"eslint-config-prettier": "^
|
|
25
|
-
"eslint-import-resolver-typescript": "^
|
|
22
|
+
"eslint": "^8.38.0",
|
|
23
|
+
"eslint-config-airbnb-base": "^15.0.0",
|
|
24
|
+
"eslint-config-prettier": "^8.8.0",
|
|
25
|
+
"eslint-import-resolver-typescript": "^3.5.5",
|
|
26
26
|
"eslint-import-resolver-webpack": "^0.13.2",
|
|
27
27
|
"eslint-plugin-eslint-comments": "^3.2.0",
|
|
28
|
-
"eslint-plugin-import": "^2.
|
|
29
|
-
"eslint-plugin-jest": "^
|
|
30
|
-
"eslint-plugin-prettier": "^
|
|
31
|
-
"eslint-plugin-promise": "^
|
|
32
|
-
"eslint-plugin-sort-class-members": "^1.
|
|
33
|
-
"prettier": "2.
|
|
28
|
+
"eslint-plugin-import": "^2.27.5",
|
|
29
|
+
"eslint-plugin-jest": "^27.2.1",
|
|
30
|
+
"eslint-plugin-prettier": "^4.2.1",
|
|
31
|
+
"eslint-plugin-promise": "^6.1.1",
|
|
32
|
+
"eslint-plugin-sort-class-members": "^1.17.1",
|
|
33
|
+
"prettier": "2.8.7"
|
|
34
34
|
},
|
|
35
35
|
"publishConfig": {
|
|
36
36
|
"access": "public"
|
|
37
37
|
},
|
|
38
|
-
"
|
|
38
|
+
"devDependencies": {
|
|
39
|
+
"eslint-formatter-codeframe": "^7.32.1"
|
|
40
|
+
},
|
|
41
|
+
"gitHead": "8eb1e2aa24ef48b12829d68abc3ca0c1eaf01bc8"
|
|
39
42
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ESLint } from 'eslint';
|
|
2
2
|
import path from 'path';
|
|
3
3
|
|
|
4
4
|
describe('import / happy path', () => {
|
|
5
|
-
const cli = new
|
|
5
|
+
const cli = new ESLint({
|
|
6
6
|
cwd: path.join(__dirname, '..'),
|
|
7
7
|
useEslintrc: false,
|
|
8
8
|
baseConfig: {
|
|
@@ -16,12 +16,12 @@ describe('import / happy path', () => {
|
|
|
16
16
|
},
|
|
17
17
|
});
|
|
18
18
|
|
|
19
|
-
it('happy', () => {
|
|
20
|
-
const codeframe = cli.
|
|
21
|
-
const
|
|
19
|
+
it('happy', async () => {
|
|
20
|
+
const codeframe = await cli.loadFormatter('codeframe');
|
|
21
|
+
const results = await cli.lintFiles([
|
|
22
22
|
path.join(__dirname, './__fixtures__/import-happy.fixture.js'),
|
|
23
23
|
]);
|
|
24
24
|
|
|
25
|
-
expect(codeframe(
|
|
25
|
+
expect(codeframe.format(results)).toMatchSnapshot();
|
|
26
26
|
});
|
|
27
27
|
});
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ESLint } from 'eslint';
|
|
2
2
|
import path from 'path';
|
|
3
3
|
|
|
4
4
|
describe('import / unhappy path', () => {
|
|
5
|
-
const cli = new
|
|
5
|
+
const cli = new ESLint({
|
|
6
6
|
cwd: path.join(__dirname, '..'),
|
|
7
7
|
useEslintrc: false,
|
|
8
8
|
baseConfig: {
|
|
@@ -16,12 +16,12 @@ describe('import / unhappy path', () => {
|
|
|
16
16
|
},
|
|
17
17
|
});
|
|
18
18
|
|
|
19
|
-
it('unhappy', () => {
|
|
20
|
-
const codeframe = cli.
|
|
21
|
-
const
|
|
19
|
+
it('unhappy', async () => {
|
|
20
|
+
const codeframe = await cli.loadFormatter('codeframe');
|
|
21
|
+
const results = await cli.lintFiles([
|
|
22
22
|
path.join(__dirname, './__fixtures__/import-unhappy.fixture.js'),
|
|
23
23
|
]);
|
|
24
24
|
|
|
25
|
-
expect(codeframe(
|
|
25
|
+
expect(codeframe.format(results)).toMatchSnapshot();
|
|
26
26
|
});
|
|
27
27
|
});
|
package/test/index.test.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ESLint } from 'eslint';
|
|
2
2
|
import path from 'path';
|
|
3
3
|
|
|
4
4
|
describe('@tinkoff/eslint-config', () => {
|
|
5
5
|
it('app config working', () => {
|
|
6
|
-
const cli = new
|
|
6
|
+
const cli = new ESLint({
|
|
7
7
|
useEslintrc: false,
|
|
8
8
|
cwd: path.join(__dirname, '..'),
|
|
9
9
|
baseConfig: {
|
|
@@ -11,14 +11,14 @@ describe('@tinkoff/eslint-config', () => {
|
|
|
11
11
|
},
|
|
12
12
|
});
|
|
13
13
|
|
|
14
|
-
expect(() => cli.
|
|
14
|
+
expect(() => cli.lintText(`const foo = 'bar';`)).not.toThrow();
|
|
15
15
|
expect(() =>
|
|
16
|
-
cli.
|
|
16
|
+
cli.lintText(`const foo = 'bar';`, { filePath: 'index.ts' })
|
|
17
17
|
).not.toThrow();
|
|
18
18
|
});
|
|
19
19
|
|
|
20
20
|
it('lib config working', () => {
|
|
21
|
-
const cli = new
|
|
21
|
+
const cli = new ESLint({
|
|
22
22
|
useEslintrc: false,
|
|
23
23
|
cwd: path.join(__dirname, '..'),
|
|
24
24
|
baseConfig: {
|
|
@@ -26,14 +26,14 @@ describe('@tinkoff/eslint-config', () => {
|
|
|
26
26
|
},
|
|
27
27
|
});
|
|
28
28
|
|
|
29
|
-
expect(() => cli.
|
|
29
|
+
expect(() => cli.lintText(`const foo = 'bar';`)).not.toThrow();
|
|
30
30
|
expect(() =>
|
|
31
|
-
cli.
|
|
31
|
+
cli.lintText(`const foo = 'bar';`, { filePath: 'index.ts' })
|
|
32
32
|
).not.toThrow();
|
|
33
33
|
});
|
|
34
34
|
|
|
35
35
|
it('jest config working', () => {
|
|
36
|
-
const cli = new
|
|
36
|
+
const cli = new ESLint({
|
|
37
37
|
useEslintrc: false,
|
|
38
38
|
cwd: path.join(__dirname, '..'),
|
|
39
39
|
baseConfig: {
|
|
@@ -41,12 +41,12 @@ describe('@tinkoff/eslint-config', () => {
|
|
|
41
41
|
},
|
|
42
42
|
});
|
|
43
43
|
|
|
44
|
-
expect(() => cli.
|
|
44
|
+
expect(() => cli.lintText(`const foo = 'bar';`)).not.toThrow();
|
|
45
45
|
expect(() =>
|
|
46
|
-
cli.
|
|
46
|
+
cli.lintText(`const foo = 'bar';`, { filePath: 'index.ts' })
|
|
47
47
|
).not.toThrow();
|
|
48
48
|
expect(() =>
|
|
49
|
-
cli.
|
|
49
|
+
cli.lintText(`const foo = 'bar';`, { filePath: 'index.spec.ts' })
|
|
50
50
|
).not.toThrow();
|
|
51
51
|
});
|
|
52
52
|
});
|