Skip to content

Commit 4798a90

Browse files
author
Robert Jackson
authored
Merge pull request #153 from volta-cli/rwjblue/update-linting
Update linting related dependencies to latest
2 parents 266a6b1 + 55efce1 commit 4798a90

File tree

7 files changed

+406
-345
lines changed

7 files changed

+406
-345
lines changed

.eslintignore

Lines changed: 0 additions & 4 deletions
This file was deleted.

.eslintrc.cjs

Lines changed: 0 additions & 34 deletions
This file was deleted.

eslint.config.mjs

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
import prettier from 'eslint-plugin-prettier';
2+
import globals from 'globals';
3+
import typescriptEslint from '@typescript-eslint/eslint-plugin';
4+
import tsParser from '@typescript-eslint/parser';
5+
import path from 'node:path';
6+
import { fileURLToPath } from 'node:url';
7+
import js from '@eslint/js';
8+
import { FlatCompat } from '@eslint/eslintrc';
9+
10+
const __filename = fileURLToPath(import.meta.url);
11+
const __dirname = path.dirname(__filename);
12+
const compat = new FlatCompat({
13+
baseDirectory: __dirname,
14+
recommendedConfig: js.configs.recommended,
15+
allConfig: js.configs.all,
16+
});
17+
18+
export default [
19+
{
20+
ignores: ['!**/.*', 'lib/', 'dist/', 'node_modules/'],
21+
},
22+
...compat.extends('eslint:recommended', 'plugin:prettier/recommended'),
23+
{
24+
plugins: {
25+
prettier,
26+
},
27+
28+
languageOptions: {
29+
globals: {
30+
...globals.node,
31+
},
32+
33+
ecmaVersion: 2020,
34+
sourceType: 'module',
35+
},
36+
37+
rules: {},
38+
},
39+
...compat.extends('plugin:@typescript-eslint/recommended').map((config) => ({
40+
...config,
41+
files: ['**/*.ts'],
42+
})),
43+
{
44+
files: ['**/*.ts'],
45+
46+
plugins: {
47+
'@typescript-eslint': typescriptEslint,
48+
},
49+
50+
languageOptions: {
51+
parser: tsParser,
52+
ecmaVersion: 2020,
53+
sourceType: 'module',
54+
},
55+
},
56+
{
57+
files: ['__tests__/**/*.[jt]s', '**/*.test.[jt]s'],
58+
59+
languageOptions: {
60+
globals: {
61+
...globals.jest,
62+
},
63+
},
64+
},
65+
];

0 commit comments

Comments
 (0)