@tinkoff/eslint-config 1.54.3 → 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 CHANGED
@@ -3,6 +3,30 @@
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
+
21
+ ### [1.54.4](https://github.com/tramvaijs/linters/compare/v1.54.3...v1.54.4) (2023-09-25)
22
+
23
+
24
+ ### Bug Fixes
25
+
26
+ * **eslint-config:** add tsx extension to errors config ([509e882](https://github.com/tramvaijs/linters/commit/509e8826a3e05b603ac740706ed65b0134bbd35f))
27
+
28
+
29
+
6
30
  ### [1.54.3](https://github.com/tramvaijs/linters/compare/v1.54.2...v1.54.3) (2023-09-22)
7
31
 
8
32
  **Note:** Version bump only for package @tinkoff/eslint-config
package/errors/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  module.exports = {
2
2
  overrides: [
3
3
  {
4
- files: ['*.js', '*.ts'],
4
+ files: ['*.js', '*.ts', '*.tsx'],
5
5
  parser: '@typescript-eslint/parser',
6
6
  extends: ['eslint-config-airbnb-base/rules/errors'],
7
7
  rules: {
@@ -5,7 +5,7 @@ module.exports = {
5
5
  {
6
6
  extends: [
7
7
  'plugin:@typescript-eslint/recommended',
8
- 'prettier/@typescript-eslint',
8
+ 'prettier',
9
9
  'plugin:import/typescript',
10
10
  ],
11
11
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tinkoff/eslint-config",
3
- "version": "1.54.3",
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.19.1",
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": "^7.5.0",
23
- "eslint-config-airbnb-base": "^14.2.1",
24
- "eslint-config-prettier": "^6.15.0",
25
- "eslint-import-resolver-typescript": "^2.7.1",
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.26.0",
29
- "eslint-plugin-jest": "^26.5.3",
30
- "eslint-plugin-prettier": "^3.4.1",
31
- "eslint-plugin-promise": "^4.3.1",
32
- "eslint-plugin-sort-class-members": "^1.14.1",
33
- "prettier": "2.6.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
- "gitHead": "7611f4cfd29f8fb555a068e7c58af0a900efa71a"
38
+ "devDependencies": {
39
+ "eslint-formatter-codeframe": "^7.32.1"
40
+ },
41
+ "gitHead": "8eb1e2aa24ef48b12829d68abc3ca0c1eaf01bc8"
39
42
  }
@@ -1,8 +1,8 @@
1
- import ESlint from 'eslint';
1
+ import { ESLint } from 'eslint';
2
2
  import path from 'path';
3
3
 
4
4
  describe('import / happy path', () => {
5
- const cli = new ESlint.CLIEngine({
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.getFormatter('codeframe');
21
- const report = cli.executeOnFiles([
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(report.results)).toMatchSnapshot();
25
+ expect(codeframe.format(results)).toMatchSnapshot();
26
26
  });
27
27
  });
@@ -1,8 +1,8 @@
1
- import ESlint from 'eslint';
1
+ import { ESLint } from 'eslint';
2
2
  import path from 'path';
3
3
 
4
4
  describe('import / unhappy path', () => {
5
- const cli = new ESlint.CLIEngine({
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.getFormatter('codeframe');
21
- const report = cli.executeOnFiles([
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(report.results)).toMatchSnapshot();
25
+ expect(codeframe.format(results)).toMatchSnapshot();
26
26
  });
27
27
  });
@@ -1,9 +1,9 @@
1
- import ESlint from 'eslint';
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 ESlint.CLIEngine({
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.executeOnText(`const foo = 'bar';`)).not.toThrow();
14
+ expect(() => cli.lintText(`const foo = 'bar';`)).not.toThrow();
15
15
  expect(() =>
16
- cli.executeOnText(`const foo = 'bar';`, 'index.ts')
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 ESlint.CLIEngine({
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.executeOnText(`const foo = 'bar';`)).not.toThrow();
29
+ expect(() => cli.lintText(`const foo = 'bar';`)).not.toThrow();
30
30
  expect(() =>
31
- cli.executeOnText(`const foo = 'bar';`, 'index.ts')
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 ESlint.CLIEngine({
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.executeOnText(`const foo = 'bar';`)).not.toThrow();
44
+ expect(() => cli.lintText(`const foo = 'bar';`)).not.toThrow();
45
45
  expect(() =>
46
- cli.executeOnText(`const foo = 'bar';`, 'index.ts')
46
+ cli.lintText(`const foo = 'bar';`, { filePath: 'index.ts' })
47
47
  ).not.toThrow();
48
48
  expect(() =>
49
- cli.executeOnText(`const foo = 'bar';`, 'index.spec.ts')
49
+ cli.lintText(`const foo = 'bar';`, { filePath: 'index.spec.ts' })
50
50
  ).not.toThrow();
51
51
  });
52
52
  });