@tinkoff/eslint-config 1.36.2 → 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 +18 -0
- package/internal/import.js +1 -1
- package/internal/typescript.js +14 -0
- 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,24 @@
|
|
|
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
|
+
|
|
15
|
+
## [1.37.0](https://github.com/TinkoffCreditSystems/linters/compare/v1.36.2...v1.37.0) (2022-10-14)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Features
|
|
19
|
+
|
|
20
|
+
* **eslint-config:** allow break convention for quoted names ([#207](https://github.com/TinkoffCreditSystems/linters/issues/207)) ([ffe15c4](https://github.com/TinkoffCreditSystems/linters/commit/ffe15c494bc08d401344ed3cab4fc9d6ef6d24a7))
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
6
24
|
### [1.36.2](https://github.com/TinkoffCreditSystems/linters/compare/v1.36.1...v1.36.2) (2022-10-13)
|
|
7
25
|
|
|
8
26
|
**Note:** Version bump only for package @tinkoff/eslint-config
|
package/internal/import.js
CHANGED
package/internal/typescript.js
CHANGED
|
@@ -101,6 +101,20 @@ module.exports = {
|
|
|
101
101
|
selector: 'property',
|
|
102
102
|
format: ['camelCase', 'PascalCase'],
|
|
103
103
|
},
|
|
104
|
+
{
|
|
105
|
+
selector: [
|
|
106
|
+
'classProperty',
|
|
107
|
+
'objectLiteralProperty',
|
|
108
|
+
'typeProperty',
|
|
109
|
+
'classMethod',
|
|
110
|
+
'objectLiteralMethod',
|
|
111
|
+
'typeMethod',
|
|
112
|
+
'accessor',
|
|
113
|
+
'enumMember',
|
|
114
|
+
],
|
|
115
|
+
format: null,
|
|
116
|
+
modifiers: ['requiresQuotes'],
|
|
117
|
+
},
|
|
104
118
|
],
|
|
105
119
|
'@typescript-eslint/ban-ts-comment': 'warn',
|
|
106
120
|
'@typescript-eslint/no-empty-function': 'warn',
|
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
|
+
});
|