Skip to content

Commit 41a3651

Browse files
committed
Update TODO items and fix rules for eslint
- Add `node:` prefix for built-in modules - Fix `@typescript-eslint/no-this-alias` rule - Remove `eager_offset.ts`
1 parent 097a2f3 commit 41a3651

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+56
-123
lines changed

.eslintrc.cjs

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,17 @@ module.exports = {
99
'packages/cli/tests/cli/validation',
1010
'packages/ts/test/',
1111
'examples',
12-
'cf-pages/*',
13-
'vitest.config.ts',
12+
'vitest.config.ts'
1413
],
1514
rules: {
1615
// not necessary here, we dont build with bob
1716
'import/extensions': 'off',
1817
// pushing to array multiple times is not a big deal
1918
'unicorn/no-array-push-push': 'off',
20-
// TODO: warning for now, clean up
21-
'@typescript-eslint/no-this-alias': 'warn',
2219
// TODO: remove default exports, breaking change?
2320
'import/no-default-export': 'off',
2421
// TODO: remove once we get rid of all anys
2522
'@typescript-eslint/no-explicit-any': 'off',
26-
// TODO: not ready yet
27-
'unicorn/prefer-node-protocol': 'off',
2823
'@typescript-eslint/ban-types': 'off',
2924
// AssemblyScript `===` is a reference equality check, not a value equality check. We are trying to do a value check. Learn more: https://github.com/AssemblyScript/assemblyscript/issues/621#issuecomment-497973428
3025
eqeqeq: 'off',
@@ -36,12 +31,8 @@ module.exports = {
3631
rules: {
3732
// TODO: want to avoid any structural change so fix it later
3833
'@typescript-eslint/no-namespace': 'off',
39-
// TODO: warning for now, clean up
40-
'unicorn/filename-case': 'warn',
41-
// TODO: warning for now, clean up
42-
'sonarjs/no-inverted-boolean-check': 'warn',
43-
// TODO: warning for now, clean up
44-
'@typescript-eslint/no-loss-of-precision': 'warn',
34+
// Some operator depend on the implementation of others, prevent recursion
35+
'sonarjs/no-inverted-boolean-check': 'off',
4536
'no-loss-of-precision': 'warn',
4637
// AssemblyScript types are different from TS and in cases we want to use what TS may think we should not,
4738
},

.prettierignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,4 @@ packages/cli/tests/cli/init
66
packages/cli/tests/cli/validation
77
packages/cli/tests/cli/add
88
pnpm-lock.yaml
9-
cf-pages/**
109
website/src/graphql-env.d.ts

packages/cli/src/codegen/schema.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import assert from 'assert';
1+
import assert from 'node:assert';
22
import * as graphql from 'graphql/language/index.js';
33
import prettier from 'prettier';
44
import { describe, expect, test } from 'vitest';

packages/cli/src/command-helpers/auth.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import fs from 'fs';
2-
import os from 'os';
3-
import path from 'path';
1+
import fs from 'node:fs';
2+
import os from 'node:os';
3+
import path from 'node:path';
44
import * as toolbox from 'gluegun';
55
import { normalizeNodeUrl } from './node.js';
66

packages/cli/src/command-helpers/compiler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { URL } from 'url';
1+
import { URL } from 'node:url';
22
import * as toolbox from 'gluegun';
33
import Compiler from '../compiler/index.js';
44
import { GRAPH_CLI_SHARED_HEADERS } from '../constants.js';

packages/cli/src/command-helpers/fs.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import path from 'path';
1+
import path from 'node:path';
22

33
const displayPath = (p: string) => path.relative(process.cwd(), p);
44

packages/cli/src/command-helpers/network.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import path from 'path';
1+
import path from 'node:path';
22
import * as toolbox from 'gluegun';
33
import { afterAll, beforeAll, describe, expect, test } from 'vitest';
44
import yaml from 'yaml';

packages/cli/src/command-helpers/network.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import path from 'path';
1+
import path from 'node:path';
22
import { filesystem, patching } from 'gluegun';
33
import yaml from 'yaml';
44
import { step, withSpinner } from './spinner.js';

packages/cli/src/command-helpers/node.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { URL } from 'url';
1+
import { URL } from 'node:url';
22
import { print } from 'gluegun';
33

44
export const SUBGRAPH_STUDIO_URL = 'https://api.studio.thegraph.com/deploy/';

packages/cli/src/command-helpers/scaffold.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import path from 'path';
1+
import path from 'node:path';
22
import fs from 'fs-extra';
33
import { strings } from 'gluegun';
44
import { Map } from 'immutable';

0 commit comments

Comments
 (0)