Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .claude/commands/lint-enforce.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Please follow the following process when I ask you to enfore a new lint rule using /lint-enforce $rule

1. Create and change to a new branch. Ask for the branch name.
2. Configure the rule to error in biome.json
3. Run lint (npm run lint). If there are NO errors, goto step 9
4. If there are no errors goto X
5. Use biome to SAFELY auto fix (npm run lint -- --fix). If there are errors stop and ask for instruction.
7. Run the tests (npm test). If there are errors, stop and ask for instruction.
8. If the rule defaults to error, delete it (See https://biomejs.dev/linter/javascript/rules/ for rule details)
9. Update the project changelog
10. Add the changes
11. Commit the changes
12. Push the changes
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
- Add node: protocol prefix to Node.js builtin module imports for clarity
- Use modern exponentiation operator (**) instead of Math.pow()
- Replace string concatenation with modern template literals
- Remove redundant 'use strict' directives as modules are automatically in strict mode

## v0.10.9
- Add support for IPv6 urls
Expand Down
2 changes: 1 addition & 1 deletion biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"useLiteralKeys": "off"
},
"suspicious": {
"noRedundantUseStrict": "off",
"noRedundantUseStrict": "error",
"noAssignInExpressions": "off",
"noAsyncPromiseExecutor": "off",
"noDoubleEquals": "off",
Expand Down
2 changes: 0 additions & 2 deletions examples/receive_generator.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
#!/usr/bin/env node

'use strict';
const co = require('co');
const amqp = require('amqplib');
const readline = require('node:readline');
Expand Down
2 changes: 0 additions & 2 deletions examples/send_generators.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#!/usr/bin/env node

'use strict';

// NB this requires the module 'co':
// npm install co
const co = require('co');
Expand Down
6 changes: 0 additions & 6 deletions lib/api_args.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
//
//
//

'use strict';

/*
The channel (promise) and callback APIs have similar signatures, and
in particular, both need AMQP fields prepared from the same arguments
Expand Down
6 changes: 0 additions & 6 deletions lib/bitset.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
//
//
//

'use strict';

/**
* A bitset implementation, after that in java.util. Yes there
* already exist such things, but none implement next{Clear|Set}Bit or
Expand Down
6 changes: 0 additions & 6 deletions lib/callback_model.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
//
//
//

'use strict';

const defs = require('./defs');
const EventEmitter = require('node:events');
const BaseChannel = require('./channel').BaseChannel;
Expand Down
8 changes: 0 additions & 8 deletions lib/channel.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
//
//
//

// Channel machinery.

'use strict';

const defs = require('./defs');
const closeMsg = require('./format').closeMessage;
const inspect = require('./format').inspect;
Expand Down
6 changes: 0 additions & 6 deletions lib/channel_model.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
//
//
//

'use strict';

const EventEmitter = require('node:events');
const promisify = require('node:util').promisify;
const defs = require('./defs');
Expand Down
8 changes: 0 additions & 8 deletions lib/codec.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
//
//
//

/*

The AMQP 0-9-1 is a mess when it comes to the types that can be
encoded on the wire.

Expand Down Expand Up @@ -48,11 +43,8 @@ except that they appear in content header frames, which include a
content size, and they carry a set of flags indicating which
properties are present. This scheme can save ones of bytes per message
(messages which take a minimum of three frames each to send).

*/

'use strict';

const ints = require('buffer-more-ints');
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like Claude or Biome went a bit far. I'll restore the legit comments


// JavaScript uses only doubles so what I'm testing for is whether
Expand Down
8 changes: 0 additions & 8 deletions lib/connect.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
//
//
//

// General-purpose API for glueing everything together.

'use strict';

const URL = require('url-parse');
const QS = require('node:querystring');
const Connection = require('./connection').Connection;
Expand Down
6 changes: 0 additions & 6 deletions lib/connection.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
//
//
//

'use strict';

const defs = require('./defs');
const constants = defs.constants;
const frame = require('./frame');
Expand Down
8 changes: 0 additions & 8 deletions lib/format.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
//
//
//

// Stringifying various things

'use strict';

const defs = require('./defs');
const format = require('node:util').format;
const HEARTBEAT = require('./frame').HEARTBEAT;
Expand Down
6 changes: 0 additions & 6 deletions lib/frame.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
// The river sweeps through
// Silt and twigs, gravel and leaves
// Driving the wheel on

'use strict';

const ints = require('buffer-more-ints');
const defs = require('./defs');
const constants = defs.constants;
Expand Down
6 changes: 0 additions & 6 deletions lib/heartbeat.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
//
//
//

// Heartbeats. In AMQP both clients and servers may expect a heartbeat
// frame if there is no activity on the connection for a negotiated
// period of time. If there's no activity for two such intervals, the
Expand Down Expand Up @@ -45,8 +41,6 @@
// %% Yes, I could apply the same 'actually passage of time' thing to
// %% send as well as to recv.

'use strict';

const EventEmitter = require('node:events');

// Exported so that we can mess with it in tests
Expand Down
6 changes: 0 additions & 6 deletions lib/mux.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
//
//
//

'use strict';

// A Mux is an object into which other readable streams may be piped;
// it then writes 'packets' from the upstreams to the given
// downstream.
Expand Down
2 changes: 0 additions & 2 deletions test/bitset.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

const claire = require('claire');
const {BitSet} = require('../lib/bitset');

Expand Down
2 changes: 0 additions & 2 deletions test/callback_api.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

const assert = require('node:assert');
const api = require('../callback_api');
const util = require('./util');
Expand Down
4 changes: 0 additions & 4 deletions test/channel.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
// Test the channel machinery

'use strict';

const assert = require('node:assert');
const promisify = require('node:util').promisify;
const Channel = require('../lib/channel').Channel;
Expand Down
2 changes: 0 additions & 2 deletions test/channel_api.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

const assert = require('node:assert');
const api = require('../channel_api');
const util = require('./util');
Expand Down
2 changes: 0 additions & 2 deletions test/codec.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

const codec = require('../lib/codec');
const defs = require('../lib/defs');
const assert = require('node:assert');
Expand Down
2 changes: 0 additions & 2 deletions test/connect.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

const connect = require('../lib/connect').connect;
const credentialsFromUrl = require('../lib/connect').credentialsFromUrl;
const defs = require('../lib/defs');
Expand Down
2 changes: 0 additions & 2 deletions test/connection.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

const assert = require('node:assert');
const defs = require('../lib/defs');
const Connection = require('../lib/connection').Connection;
Expand Down
4 changes: 0 additions & 4 deletions test/data.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
// Property-based testing representations of various things in AMQP

'use strict';

const C = require('claire');
const forAll = C.forAll;
const arb = C.data;
Expand Down
2 changes: 0 additions & 2 deletions test/frame.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

const assert = require('node:assert');
const connection = require('../lib/connection');
const Frames = connection.Connection;
Expand Down
2 changes: 0 additions & 2 deletions test/mux.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

const assert = require('node:assert');
const Mux = require('../lib/mux').Mux;
const PassThrough = require('node:stream').PassThrough;
Expand Down
2 changes: 0 additions & 2 deletions test/util.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

const crypto = require('node:crypto');
const Connection = require('../lib/connection').Connection;
const PassThrough = require('node:stream').PassThrough;
Expand Down