Skip to main content

Assess, plan, evolve.

Reusable compiler-aware skills that help coding agents understand, plan, and safely evolve your codebase.

17 packages

Sort by
E
@e18e/index-of

# Index Of Codemod ## Introduction This codemod replaces instances of the `index-of` array method with the built-in `indexOf` method. By utilizing native JavaScript features, this transformation reduces dependency on external libraries, improving performance and bundle size. ### Before ```javascript import indexOf from 'index-of'; const items = [1, 2, 3]; const index = indexOf(items, 2); ``` ### After ```javascript const items = [1, 2, 3]; const index = items.indexOf(2); ```

e18emodule-replacement
v1.0.5
e18e
35
a year ago
E
@e18e/last-index-of

# Last Index Of Codemod ## Introduction This codemod replaces the use of a custom `last-index-of` module with the built-in `Array.prototype.lastIndexOf` method. This transformation simplifies the codebase by removing the dependency on an external module and utilizes a native JavaScript feature for improved performance. ### Before ```javascript import lastIndexOf from 'last-index-of'; const index = lastIndexOf(array, value); ``` ### After ```javascript const index = array.lastIndexOf(value); ```

e18emodule-replacement
v1.0.5
e18e
34
a year ago
3
elasticsearch/8/unify-return-value

This codemod updates the API response structure for search calls, replacing the previous body-only return with an object containing additional fields like `statusCode`, `headers`, and `warnings` ## What Changed Previously, the return value of search calls differed based on whether a callback or promise was used: - For promises, only the body was returned. - For callbacks, body, statusCode, and headers were returned separately. Now, both callbacks and promises return an object containing body, statusCode, headers, warnings, and meta. ## Before ```jsx // Promise const body = await client.search({ index: 'my-index', body: { foo: 'bar' } }); // Callback client.search({ index: 'my-index', body: { foo: 'bar' } }, (err, body, statusCode, headers) => { if (err) console.log(err); }); ``` ## After ```jsx // Promise const { body, statusCode, headers, warnings } = await client.search({ index: 'my-index', body: { foo: 'bar' } }); // Callback client.search({ index: 'my-index', body: { foo: 'bar' } }, (err, { body, statusCode, headers, warnings }) => { if (err) console.log(err); }); ```

elasticsearch8+1
v1.0.1
35c4n0r
0
2 years ago
3
elasticsearch/8/move-client-configurations

This codemod moves the client-related configuration parameters (ignore, headers, requestTimeout, and maxRetries) from the API object to the second options object. ## What Changed Previously, ignore, headers, requestTimeout, and maxRetries could be passed directly inside the API object. Now, these parameters need to be specified in a second options object. Now, both callbacks and promises return an object containing body, statusCode, headers, warnings, and meta. ## Before ```jsx const body = await client.search({ index: 'my-index', body: { foo: 'bar' }, ignore: [404] }); client.search({ index: 'my-index', body: { foo: 'bar' }, ignore: [404] }, (err, body, statusCode, headers) => { if (err) console.log(err); }); ``` ## After ```jsx const { body, statusCode, headers, warnings } = await client.search({ index: 'my-index', body: { foo: 'bar' } }, { ignore: [404] }); client.search({ index: 'my-index', body: { foo: 'bar' } }, { ignore: [404] }, (err, { body, statusCode, headers, warnings }) => { if (err) console.log(err); }); ```

elasticsearch8+1
v1.0.1
35c4n0r
0
2 years ago
Aalexbit-codemod avatar
mine-prisma-sql-index-risks

Detect possible missing-index risks in Prisma queries and embedded SQL

prismasql+3
v0.0.1
alexbit-codemod
3
4 months ago
C
sql/add-index-before-select

Example of using codemod that changes SQL. It detects all SELECT statements and adds an index creation statement before them. Inside SELECT statement for any fields that ends with `_id` it creates an index on that field. ## Example ### Before ```sql select * FROM orders WHERE customer_id = 123; ``` ### After ```ts CREATE INDEX idx_customer_id ON orders(customer_id); SELECT * FROM orders WHERE customer_id = 123; ```

sqlindex
v1.0.0
Codemod
0
2 years ago
AAugustinMauroy avatar
vitejs-migrate-transform-index-html-hooks

Migrate transform index HTML hooks

vitevitejs
v1.0.0
AugustinMauroy
0
a month ago
E
@e18e/array.prototype.indexof

# Array.prototype.indexOf Codemod ## Introduction This codemod transforms calls to `array.prototype.indexof` (with a lowercase "o") to the built-in `indexOf` method of arrays. This replacement reduces reliance on error-prone custom implementations and leverages the native functionality, improving code performance and readability. ### Before ```javascript const index = array.prototype.indexof(array, value); ``` ### After ```javascript const index = array.indexOf(value); ```

e18emodule-replacement
v1.0.5
e18e
35
a year ago
E
@e18e/array.prototype.findindex

# array.prototype.findindex Codemod ## Introduction This codemod replaces instances of `array.prototype.findindex` with the built-in `Array.prototype.findIndex` method. By making this change, we eliminate the need for an external dependency, which helps reduce bundle size and improves performance. ### Before ```javascript const index = array.prototype.findindex(array, element); ``` ### After ```javascript const index = array.findIndex(element); ```

e18emodule-replacement
v1.0.5
e18e
39
a year ago
E
@e18e/array.prototype.findlastindex

# Array Prototype Find Last Index Codemod ## Introduction This codemod transforms the usage of the `Array.prototype.findLastIndex` method to its more efficient counterpart, ensuring consistent coding practices and potentially reducing bundle size by leveraging built-in ES features instead of polyfills or outdated methods. ### Before ```javascript const array = [1, 2, 3, 4, 5]; const lastIndex = array.findLastIndex(element => element === 3); ``` ### After ```javascript const array = [1, 2, 3, 4, 5]; const lastIndex = array.findLastIndex(element => element === 3); ```

e18emodule-replacement
v1.0.5
e18e
33
a year ago
Ccodemod avatar
codemod/csharp-indexof-ambiguous-positive-check
PRO

Read-only C# analysis codemod that detects IndexOf-style comparisons such as > 0 or >= 1, which exclude valid index-0 matches, and emits provider-neutral findings plus metrics for remediation planning.

csharpanalysis+2
v1.0.2
codemod
15
a month ago
E
@e18e/split-lines

# Split Lines Codemod ## Introduction This codemod replaces the usage of the `split-lines` npm module with native JavaScript string methods. The goal is to eliminate an unnecessary dependency, optimize the codebase, and enhance performance by utilizing built-in ES features. ### Before ```javascript import splitLines from 'split-lines'; const lines = splitLines(someString, { preserveNewlines: true }); ``` ### After ```javascript const lines = someString.split(/(\r?\n)/).reduce((acc, part, index, array) => { if (index % 2 === 0) { acc.push(part + (array[index + 1] || '')); } return acc; }, []); ```

e18emodule-replacement
v1.0.5
e18e
38
a year ago

Ready to evolve your codebase?

Build tailored, compiler-aware skills to assess, plan, and automate complex codebase changes.