Skip to content

Commit c15740a

Browse files
Expand ESLint support for TypeScript and add max-warnings CLI option (#36)
2 parents e4fd177 + 4c3c3f4 commit c15740a

File tree

20 files changed

+53
-15
lines changed

20 files changed

+53
-15
lines changed

.changeset/cruel-breads-read.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@tcd-devkit/eslint-config-ts': patch
3+
---
4+
5+
Fix ESLint errors

.changeset/khaki-pigs-wink.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@tcd-devkit/eslint-preset-node': patch
3+
---
4+
5+
Properly configure Node ENV

.changeset/salty-pianos-write.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@tcd-devkit/scripts': patch
3+
---
4+
5+
Add max-warnings arg for ESLint

.changeset/solid-lands-tickle.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@tcd-devkit/eslint-config-import': patch
3+
'@tcd-devkit/eslint-config': patch
4+
---
5+
6+
Add missing TypeScript file extensions

commitlint.config.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
/**
2-
* @type {import('@commitlint/types').UserConfig}
3-
*/
1+
/** @type {import('@commitlint/types').UserConfig} */
42
export default {
53
extends: ['@tcd-devkit'],
64
};

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
"@changesets/changelog-github": "0.5.1",
2525
"@changesets/cli": "2.29.4",
2626
"@commitlint/cli": "19.8.1",
27+
"@commitlint/types": "19.8.1",
2728
"@tcd-devkit/commitlint-config": "workspace:*",
2829
"@tcd-devkit/eslint-preset-node": "workspace:*",
2930
"@tcd-devkit/prettier-config": "workspace:*",

packages/eslint-presets/eslint-preset-node/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@
5959
"@tcd-devkit/eslint-config": "workspace:*",
6060
"@tcd-devkit/eslint-config-import-ts": "workspace:*",
6161
"@tcd-devkit/eslint-config-ts": "workspace:*",
62-
"eslint-config-prettier": "10.1.5"
62+
"eslint-config-prettier": "10.1.5",
63+
"globals": "16.2.0"
6364
},
6465
"devDependencies": {
6566
"@tcd-devkit/scripts": "workspace:*",

packages/eslint-presets/eslint-preset-node/src/node-preset.linter.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import type { Linter } from 'eslint';
22
import prettierConfig from 'eslint-config-prettier/flat';
33
import { defineConfig, globalIgnores } from 'eslint/config';
4+
import globals from 'globals';
45

56
import { baseConfig } from '@tcd-devkit/eslint-config';
67
import { importTsConfig } from '@tcd-devkit/eslint-config-import-ts';
@@ -14,6 +15,11 @@ const ignoresConfig = globalIgnores(
1415
export const nodePreset: Linter.Config[] = defineConfig([
1516
{
1617
name: '@tcd-devkit/eslint-preset-node',
18+
languageOptions: {
19+
globals: {
20+
...globals.node,
21+
},
22+
},
1723
extends: [baseConfig, tsConfig, importTsConfig],
1824
},
1925
prettierConfig,

packages/eslint/eslint-config-import/src/import.linter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const importRecommended = importPluginConfigs.recommended as Linter.Config;
99
export const importConfig = defineConfig({
1010
name: '@tcd-devkit/eslint-config-import',
1111
extends: [importRecommended],
12-
files: ['**/*.{js,jsx,mjs,cjs}'],
12+
files: ['**/*.{js,jsx,ts,tsx,mjs,cjs}'],
1313
rules: importRules,
1414
});
1515

packages/eslint/eslint-config-ts/src/__tests__/rules/unbound-method.test.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,6 @@ describe(`${ruleId} rule`, () => {
99
it('should have a disabled rule', () => {
1010
const ruleValue = tsRules[ruleId];
1111

12-
console.log('tsRules:', tsRules);
13-
console.log('ruleId:', ruleId);
14-
console.log('ruleValue:', ruleValue);
15-
1612
expect(ruleValue).toEqual(['off']);
1713
});
1814
});

0 commit comments

Comments
 (0)