this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

add eslint-plugin-perfectionist

+52 -13
+9 -4
eslint.config.js
··· 1 1 import e18e from '@e18e/eslint-plugin'; 2 + import packageJson from 'eslint-plugin-package-json'; 3 + import perfectionist from 'eslint-plugin-perfectionist'; 2 4 import {defineConfig, globalIgnores} from 'eslint/config'; 3 - import packageJson from 'eslint-plugin-package-json'; 4 5 import xo from 'xo'; 5 6 6 7 export default defineConfig([ 7 8 globalIgnores(['distribution/', '.tsimp/']), 8 9 9 10 { 10 - files: ['**/*.{js,ts}'], 11 11 extends: [ 12 12 e18e.configs.recommended, 13 + perfectionist.configs['recommended-natural'], 13 14 xo.xoToEslintConfig([ 14 15 { 15 - prettier: 'compat', 16 16 languageOptions: { 17 17 parserOptions: { 18 18 projectService: { ··· 21 21 }, 22 22 }, 23 23 }, 24 + prettier: 'compat', 25 + rules: { 26 + 'import-x/order': 'off', 27 + }, 24 28 }, 25 29 ]), 26 30 ], 31 + files: ['**/*.{js,ts}'], 27 32 }, 28 33 { 34 + extends: [packageJson.configs.recommended, packageJson.configs.stylistic], 29 35 files: ['package.json'], 30 - extends: [packageJson.configs.recommended, packageJson.configs.stylistic], 31 36 rules: { 32 37 'package-json/scripts-name-casing': 'off', 33 38 },
+28
package-lock.json
··· 14 14 "@vitest/coverage-v8": "^4.1.4", 15 15 "eslint": "^10.0.3", 16 16 "eslint-plugin-package-json": "^0.91.0", 17 + "eslint-plugin-perfectionist": "^5.8.0", 17 18 "knip": "^6.4.1", 18 19 "prettier": "^3.6.2", 19 20 "typescript": "^6.0.2", ··· 4224 4225 "jsonc-eslint-parser": ">=2.0.0" 4225 4226 } 4226 4227 }, 4228 + "node_modules/eslint-plugin-perfectionist": { 4229 + "version": "5.8.0", 4230 + "resolved": "https://registry.npmjs.org/eslint-plugin-perfectionist/-/eslint-plugin-perfectionist-5.8.0.tgz", 4231 + "integrity": "sha512-k8uIptWIxkUclonCFGyDzgYs9NI+Qh0a7cUXS3L7IYZDEsjXuimFBVbxXPQQngWqMiaxJRwbtYB4smMGMqF+cw==", 4232 + "dev": true, 4233 + "license": "MIT", 4234 + "dependencies": { 4235 + "@typescript-eslint/utils": "^8.58.0", 4236 + "natural-orderby": "^5.0.0" 4237 + }, 4238 + "engines": { 4239 + "node": "^20.0.0 || >=22.0.0" 4240 + }, 4241 + "peerDependencies": { 4242 + "eslint": "^8.45.0 || ^9.0.0 || ^10.0.0" 4243 + } 4244 + }, 4227 4245 "node_modules/eslint-plugin-prettier": { 4228 4246 "version": "5.5.5", 4229 4247 "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-5.5.5.tgz", ··· 6555 6573 "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", 6556 6574 "dev": true, 6557 6575 "license": "MIT" 6576 + }, 6577 + "node_modules/natural-orderby": { 6578 + "version": "5.0.0", 6579 + "resolved": "https://registry.npmjs.org/natural-orderby/-/natural-orderby-5.0.0.tgz", 6580 + "integrity": "sha512-kKHJhxwpR/Okycz4HhQKKlhWe4ASEfPgkSWNmKFHd7+ezuQlxkA5cM3+XkBPvm1gmHen3w53qsYAv+8GwRrBlg==", 6581 + "dev": true, 6582 + "license": "MIT", 6583 + "engines": { 6584 + "node": ">=18" 6585 + } 6558 6586 }, 6559 6587 "node_modules/node-exports-info": { 6560 6588 "version": "1.6.0",
+1
package.json
··· 52 52 "@vitest/coverage-v8": "^4.1.4", 53 53 "eslint": "^10.0.3", 54 54 "eslint-plugin-package-json": "^0.91.0", 55 + "eslint-plugin-perfectionist": "^5.8.0", 55 56 "knip": "^6.4.1", 56 57 "prettier": "^3.6.2", 57 58 "typescript": "^6.0.2",
+1 -1
source/index.ts
··· 1 1 export {default as increment} from './increment.js'; 2 - export {default as range} from './range.js'; 3 2 export {default as random} from './random.js'; 3 + export {default as range} from './range.js'; 4 4 export {default as toBb26} from './to-bb26.js'; 5 5 export {default as toDecimal} from './to-decimal.js';
+4 -4
source/random.ts
··· 1 1 import toBb26 from './to-bb26.js'; 2 2 import toDecimal from './to-decimal.js'; 3 3 4 - function randomInteger(minimum: number, maximum: number): number { 5 - return Math.floor(Math.random() * (maximum - minimum + 1) + minimum); 6 - } 7 - 8 4 /** 9 5 * Produces a random string between the inclusive `lower` and `upper` bounds. If 10 6 * only one argument is provided, a string between `'A'` and the given string is ··· 25 21 26 22 return toBb26(integer); 27 23 } 24 + 25 + function randomInteger(minimum: number, maximum: number): number { 26 + return Math.floor(Math.random() * (maximum - minimum + 1) + minimum); 27 + }
+4 -4
source/to-bb26.ts
··· 1 - function toChar(number: number) { 2 - return String.fromCodePoint('A'.codePointAt(0)! - 1 + number); 3 - } 4 - 5 1 /** 6 2 * Converts a decimal number to a bijective base-26 string. 7 3 * ··· 18 14 19 15 return string; 20 16 } 17 + 18 + function toChar(number: number) { 19 + return String.fromCodePoint('A'.codePointAt(0)! - 1 + number); 20 + }
+1
test/increment.ts
··· 1 1 import {expect, test} from 'vitest'; 2 + 2 3 import {increment} from '../source/index.js'; 3 4 4 5 type TestCase = {
+1
test/random.ts
··· 1 1 import {expect, test} from 'vitest'; 2 + 2 3 import {random, range} from '../source/index.js'; 3 4 4 5 test('returns a valid string given only an upper bound', () => {
+1
test/range.ts
··· 1 1 import {expect, test} from 'vitest'; 2 + 2 3 import {range} from '../source/index.js'; 3 4 4 5 test('works with end', () => {
+1
test/to-bb26.ts
··· 1 1 import {expect, test} from 'vitest'; 2 + 2 3 import {toBb26} from '../source/index.js'; 3 4 4 5 type TestCase = {
+1
test/to-decimal.ts
··· 1 1 import {expect, test} from 'vitest'; 2 + 2 3 import {toDecimal} from '../source/index.js'; 3 4 4 5 type TestCase = {