@tinkoff/eslint-config 1.37.0 → 1.38.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 +9 -0
- package/internal/import.js +1 -1
- package/package.json +2 -2
- package/test/import/__fixtures__/dep-a.js +1 -0
- package/test/import/__fixtures__/dep-b.js +3 -0
- package/test/import/__fixtures__/import-happy.fixture.js +3 -0
- package/test/import/__fixtures__/import-unhappy.fixture.js +3 -0
- package/test/import/__snapshots__/import-happy.test.js.snap +3 -0
- package/test/import/__snapshots__/import-unhappy.test.js.snap +13 -0
- package/test/import/import-happy.test.js +27 -0
- package/test/import/import-unhappy.test.js +27 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,15 @@
|
|
|
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
|
+
## [1.38.0](https://github.com/TinkoffCreditSystems/linters/compare/v1.37.0...v1.38.0) (2022-10-25)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **eslint-config:** set import/no-cycle to error ([#206](https://github.com/TinkoffCreditSystems/linters/issues/206)) ([afab74b](https://github.com/TinkoffCreditSystems/linters/commit/afab74b1ed5f3705d75a82135a1b9c95a8a56da6))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
6
15
|
## [1.37.0](https://github.com/TinkoffCreditSystems/linters/compare/v1.36.2...v1.37.0) (2022-10-14)
|
|
7
16
|
|
|
8
17
|
|
package/internal/import.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tinkoff/eslint-config",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.38.0",
|
|
4
4
|
"description": "Tinkoff ESLint configs to rule them all",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"keywords": [
|
|
@@ -39,5 +39,5 @@
|
|
|
39
39
|
"publishConfig": {
|
|
40
40
|
"access": "public"
|
|
41
41
|
},
|
|
42
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "c5e1317c46b8be3f55023f7dcc1345577c03f339"
|
|
43
43
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function a() {}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`import / unhappy path unhappy 1`] = `
|
|
4
|
+
"error: Dependency cycle detected (import/no-cycle) at packages/eslint-config/test/import/__fixtures__/import-unhappy.fixture.js:1:1:
|
|
5
|
+
> 1 | import { b } from './dep-b';
|
|
6
|
+
| ^
|
|
7
|
+
2 |
|
|
8
|
+
3 | b();
|
|
9
|
+
4 |
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
1 error found."
|
|
13
|
+
`;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import ESlint from 'eslint';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
|
|
4
|
+
describe('import / happy path', () => {
|
|
5
|
+
const cli = new ESlint.CLIEngine({
|
|
6
|
+
cwd: path.join(__dirname, '..'),
|
|
7
|
+
useEslintrc: false,
|
|
8
|
+
baseConfig: {
|
|
9
|
+
extends: ['../internal/import'],
|
|
10
|
+
parserOptions: {
|
|
11
|
+
sourceType: 'module',
|
|
12
|
+
},
|
|
13
|
+
env: {
|
|
14
|
+
es6: true,
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
it('happy', () => {
|
|
20
|
+
const codeframe = cli.getFormatter('codeframe');
|
|
21
|
+
const report = cli.executeOnFiles([
|
|
22
|
+
path.join(__dirname, './__fixtures__/import-happy.fixture.js'),
|
|
23
|
+
]);
|
|
24
|
+
|
|
25
|
+
expect(codeframe(report.results)).toMatchSnapshot();
|
|
26
|
+
});
|
|
27
|
+
});
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import ESlint from 'eslint';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
|
|
4
|
+
describe('import / unhappy path', () => {
|
|
5
|
+
const cli = new ESlint.CLIEngine({
|
|
6
|
+
cwd: path.join(__dirname, '..'),
|
|
7
|
+
useEslintrc: false,
|
|
8
|
+
baseConfig: {
|
|
9
|
+
extends: ['../internal/import'],
|
|
10
|
+
parserOptions: {
|
|
11
|
+
sourceType: 'module',
|
|
12
|
+
},
|
|
13
|
+
env: {
|
|
14
|
+
es6: true,
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
it('unhappy', () => {
|
|
20
|
+
const codeframe = cli.getFormatter('codeframe');
|
|
21
|
+
const report = cli.executeOnFiles([
|
|
22
|
+
path.join(__dirname, './__fixtures__/import-unhappy.fixture.js'),
|
|
23
|
+
]);
|
|
24
|
+
|
|
25
|
+
expect(codeframe(report.results)).toMatchSnapshot();
|
|
26
|
+
});
|
|
27
|
+
});
|