Skip to content

Commit ce3d6ab

Browse files
renovate[bot]renovate-botcalebeby
authored
Update dependency eslint-plugin-unicorn to v41 (#339)
Co-authored-by: Renovate Bot <bot@renovateapp.com> Co-authored-by: Caleb Eby <caleb.eby01@gmail.com>
1 parent bb7da9e commit ce3d6ab

7 files changed

Lines changed: 58 additions & 119 deletions

File tree

.changeset/popular-laws-live.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
'@cloudfour/eslint-plugin': major
3+
---
4+
5+
Update `eslint-plugin-unicorn` to `v41`
6+
7+
**New Rules**
8+
9+
- [`@cloudfour/unicorn/no-await-expression-member`](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v41.0.1/docs/rules/no-await-expression-member.md)
10+
- [`@cloudfour/unicorn/no-empty-file`](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v41.0.1/docs/rules/no-empty-file.md)
11+
- [`@cloudfour/unicorn/no-thenable`](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v41.0.1/docs/rules/no-thenable.md)
12+
- [`@cloudfour/unicorn/no-useless-promise-resolve-reject`](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v41.0.1/docs/rules/no-useless-promise-resolve-reject.md)
13+
- [`@cloudfour/unicorn/prefer-code-point`](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v41.0.1/docs/rules/prefer-code-point.md)
14+
- [`@cloudfour/unicorn/prefer-export-from`](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v41.0.1/docs/rules/prefer-export-from.md)
15+
- [`@cloudfour/unicorn/prefer-json-parse-buffer`](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v41.0.1/docs/rules/prefer-json-parse-buffer.md)
16+
- [`@cloudfour/unicorn/relative-url-style`](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v41.0.1/docs/rules/relative-url-style.md)
17+
- [`@cloudfour/unicorn/text-encoding-identifier-case`](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v41.0.1/docs/rules/text-encoding-identifier-case.md)
18+
19+
**Newly Enabled Rules**
20+
21+
- [`@cloudfour/unicorn/no-await-expression-member`](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v41.0.1/docs/rules/no-await-expression-member.md)
22+
- [`@cloudfour/unicorn/no-empty-file`](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v41.0.1/docs/rules/no-empty-file.md)
23+
- [`@cloudfour/unicorn/no-thenable`](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v41.0.1/docs/rules/no-thenable.md)
24+
- [`@cloudfour/unicorn/no-useless-promise-resolve-reject`](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v41.0.1/docs/rules/no-useless-promise-resolve-reject.md)
25+
- [`@cloudfour/unicorn/prefer-code-point`](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v41.0.1/docs/rules/prefer-code-point.md)
26+
- [`@cloudfour/unicorn/prefer-export-from`](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v41.0.1/docs/rules/prefer-export-from.md)
27+
- [`@cloudfour/unicorn/relative-url-style`](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v41.0.1/docs/rules/relative-url-style.md)
28+
- [`@cloudfour/unicorn/text-encoding-identifier-case`](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v41.0.1/docs/rules/text-encoding-identifier-case.md)
29+
30+
**Newly Disabled Rules**
31+
32+
- [`@cloudfour/unicorn/require-post-message-target-origin`](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v41.0.1/docs/rules/require-post-message-target-origin.md)

fixtures/eslint/lib/linter/linter.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -654,7 +654,7 @@ function stripUnicodeBOM(text) {
654654
* In JavaScript, string data is stored as UTF-16, so BOM is 0xFEFF.
655655
* http://www.ecma-international.org/ecma-262/6.0/#sec-unicode-format-control-characters
656656
*/
657-
if (text.charCodeAt(0) === 0xfe_ff) {
657+
if (text.codePointAt(0) === 0xfe_ff) {
658658
return text.slice(1);
659659
}
660660

fixtures/eslint/lib/source-code/source-code.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ class SourceCode extends TokenStore {
186186
* The flag to indicate that the source code has Unicode BOM.
187187
* @type boolean
188188
*/
189-
this.hasBOM = text.charCodeAt(0) === 0xfe_ff;
189+
this.hasBOM = text.codePointAt(0) === 0xfe_ff;
190190

191191
/**
192192
* The original text source code.

fixtures/rollup/rollup.config.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import pkg from './package.json';
1616

1717
const commitHash = (function () {
1818
try {
19-
return fs.readFileSync('.commithash', 'utf-8');
19+
return fs.readFileSync('.commithash', 'utf8');
2020
} catch {
2121
return 'unknown';
2222
}
@@ -142,11 +142,11 @@ export default (command) => {
142142
{
143143
load: (id) => {
144144
if (id.includes('crypto.ts'))
145-
return fs.readFileSync('browser/crypto.ts', 'utf-8');
145+
return fs.readFileSync('browser/crypto.ts', 'utf8');
146146
if (id.includes('fs.ts'))
147-
return fs.readFileSync('browser/fs.ts', 'utf-8');
147+
return fs.readFileSync('browser/fs.ts', 'utf8');
148148
if (id.includes('path.ts'))
149-
return fs.readFileSync('browser/path.ts', 'utf-8');
149+
return fs.readFileSync('browser/path.ts', 'utf8');
150150
},
151151
},
152152
commonjs(),

package-lock.json

Lines changed: 16 additions & 112 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"eslint-plugin-jsdoc": "^38.0.0",
3838
"eslint-plugin-n": "^15.0.1",
3939
"eslint-plugin-promise": "^6.0.0",
40-
"eslint-plugin-unicorn": "^37.0.0"
40+
"eslint-plugin-unicorn": "^41.0.0"
4141
},
4242
"peerDependencies": {
4343
"eslint": "^8.0.0"

src/config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,9 @@ module.exports.configs = {
156156
// But this is an edge case that can be avoided through careful manual review
157157
// and sometimes through TS
158158
'unicorn/no-array-callback-reference': 'off',
159+
// https://github.com/sindresorhus/eslint-plugin-unicorn/pull/1750
160+
// This rule got removed from the recommended preset, but that hasn't been published yet.
161+
'unicorn/prefer-json-parse-buffer': 'off',
159162
// This rule changes arrays to sets if you call .includes on it
160163
// Converting from array to set has a cost itself, just like .includes has a cost
161164
// We decided to leave the decision of using arrays vs sets to human reviewers

0 commit comments

Comments
 (0)