Skip to content

Commit

Permalink
Merge pull request #153 from volta-cli/rwjblue/update-linting
Browse files Browse the repository at this point in the history
Update linting related dependencies to latest
  • Loading branch information
rwjblue authored Aug 6, 2024
2 parents 266a6b1 + 55efce1 commit 4798a90
Show file tree
Hide file tree
Showing 7 changed files with 406 additions and 345 deletions.
4 changes: 0 additions & 4 deletions .eslintignore

This file was deleted.

34 changes: 0 additions & 34 deletions .eslintrc.cjs

This file was deleted.

65 changes: 65 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
import prettier from 'eslint-plugin-prettier';
import globals from 'globals';
import typescriptEslint from '@typescript-eslint/eslint-plugin';
import tsParser from '@typescript-eslint/parser';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import js from '@eslint/js';
import { FlatCompat } from '@eslint/eslintrc';

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all,
});

export default [
{
ignores: ['!**/.*', 'lib/', 'dist/', 'node_modules/'],
},
...compat.extends('eslint:recommended', 'plugin:prettier/recommended'),
{
plugins: {
prettier,
},

languageOptions: {
globals: {
...globals.node,
},

ecmaVersion: 2020,
sourceType: 'module',
},

rules: {},
},
...compat.extends('plugin:@typescript-eslint/recommended').map((config) => ({
...config,
files: ['**/*.ts'],
})),
{
files: ['**/*.ts'],

plugins: {
'@typescript-eslint': typescriptEslint,
},

languageOptions: {
parser: tsParser,
ecmaVersion: 2020,
sourceType: 'module',
},
},
{
files: ['__tests__/**/*.[jt]s', '**/*.test.[jt]s'],

languageOptions: {
globals: {
...globals.jest,
},
},
},
];
Loading

0 comments on commit 4798a90

Please sign in to comment.