Skip to content

Commit 9d44e2d

Browse files
authored
fix vulns + upgrade eslint to latest (#1183)
* fix vulns + upgrade eslint to latest * latest node * address a bots comment
1 parent 6887ceb commit 9d44e2d

16 files changed

Lines changed: 1109 additions & 1061 deletions

File tree

.eslintignore

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

.eslintrc.js

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

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Bug report
33
about: Create a report to help us improve
44
title: '[BUG]'
55
labels: bug
6-
assignees: doug-martin, dustinsmith1024
6+
assignees: dustinsmith1024
77
---
88

99
**Describe the bug**

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20.19.6
1+
20.20.0

.tool-versions

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
nodejs 20.20.0

CHANGELOG.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,7 @@
33
All notable changes to this project will be documented in this file.
44
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
55

6-
## [5.0.6](https://github.com/C2FO/fast-csv/compare/v5.0.5...v5.0.6) (2025-12-22)
7-
8-
### Security
9-
10-
- **deps:** update @docusaurus/core and @docusaurus/preset-classic to v3.9.2 to resolve security vulnerabilities
6+
## [Unreleased]
117

128
## [5.0.5](https://github.com/C2FO/fast-csv/compare/v5.0.2...v5.0.5) (2025-08-04)
139

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License
22

3-
Copyright (c) 2011-2025 C2FO
3+
Copyright (c) 2011-2026 C2FO
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

eslint.config.mjs

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
// @ts-check
2+
import path from 'node:path';
3+
import { fileURLToPath } from 'node:url';
4+
import eslint from '@eslint/js';
5+
import { defineConfig } from 'eslint/config';
6+
import tseslint from 'typescript-eslint';
7+
import globals from 'globals';
8+
9+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
10+
import prettier from 'eslint-plugin-prettier';
11+
import importPlugin from 'eslint-plugin-import';
12+
import jest from 'eslint-plugin-jest';
13+
import tsdoc from 'eslint-plugin-tsdoc';
14+
import eslintConfigPrettier from 'eslint-config-prettier';
15+
16+
export default defineConfig([
17+
// Ignore patterns (flat config: no other properties in this object)
18+
{
19+
ignores: [
20+
'**/build',
21+
'**/node_modules',
22+
'documentation',
23+
'**/.eslintrc.js',
24+
'**/.eslintrc.cjs',
25+
'**/eslint.config.*',
26+
],
27+
},
28+
29+
// Base ESLint recommended
30+
eslint.configs.recommended,
31+
32+
// TypeScript ESLint: recommended only for .ts (so .js files don't get TS rules)
33+
...tseslint.configs.recommended.map((config) => ({
34+
...config,
35+
files: ['**/*.ts'],
36+
})),
37+
38+
// Prettier: disable rules that conflict (must be last of shared configs)
39+
eslintConfigPrettier,
40+
41+
// TypeScript files: type-checked config + language options + plugins + rules
42+
...tseslint.configs.recommendedTypeChecked.map((config) => ({
43+
...config,
44+
files: ['**/*.ts'],
45+
})),
46+
{
47+
files: ['**/*.ts'],
48+
languageOptions: {
49+
parserOptions: {
50+
projectService: true,
51+
tsconfigRootDir: __dirname,
52+
},
53+
globals: {
54+
...globals.node,
55+
...globals.jest,
56+
},
57+
},
58+
plugins: {
59+
prettier,
60+
import: importPlugin,
61+
jest,
62+
tsdoc,
63+
},
64+
rules: {
65+
'@typescript-eslint/no-unsafe-argument': 'off',
66+
'@typescript-eslint/no-unsafe-return': 'warn',
67+
'@typescript-eslint/no-unsafe-assignment': 'warn',
68+
'prettier/prettier': 'error',
69+
'arrow-body-style': ['warn', 'always'],
70+
'tsdoc/syntax': 'warn',
71+
'import/prefer-default-export': 'off',
72+
'import/no-default-export': 'error',
73+
'no-underscore-dangle': 'off',
74+
},
75+
},
76+
77+
// Spec files: relax some rules
78+
{
79+
files: ['**/*.spec.ts'],
80+
rules: {
81+
'@typescript-eslint/explicit-function-return-type': 'off',
82+
'@typescript-eslint/ban-ts-comment': 'off',
83+
},
84+
},
85+
86+
// JS files (examples only) – Node globals, relax some rules
87+
{
88+
files: ['examples/**/examples/**/*.js'],
89+
languageOptions: {
90+
globals: {
91+
...globals.node,
92+
},
93+
},
94+
plugins: {
95+
prettier,
96+
import: importPlugin,
97+
jest,
98+
},
99+
rules: {
100+
'no-console': 'off',
101+
'prettier/prettier': 'error',
102+
'@typescript-eslint/no-require-imports': 'off',
103+
},
104+
},
105+
]);

0 commit comments

Comments
 (0)