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

+55 -15
+8 -3
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} 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 { 8 - files: ['**/*.js'], 9 9 extends: [ 10 10 e18e.configs.recommended, 11 + perfectionist.configs['recommended-natural'], 11 12 xo.xoToEslintConfig([ 12 13 { 13 14 prettier: 'compat', 15 + rules: { 16 + 'import-x/order': 'off', 17 + }, 14 18 }, 15 19 ]), 16 20 ], 21 + files: ['**/*.js'], 17 22 }, 18 23 { 19 - files: ['package.json'], 20 24 extends: [packageJson.configs.recommended, packageJson.configs.stylistic], 25 + files: ['package.json'], 21 26 rules: { 22 27 'package-json/require-sideEffects': 'off', 23 28 'package-json/scripts-name-casing': 'off',
+28
package-lock.json
··· 20 20 "@e18e/eslint-plugin": "^0.3.0", 21 21 "eslint": "^10.0.3", 22 22 "eslint-plugin-package-json": "^0.91.0", 23 + "eslint-plugin-perfectionist": "^5.8.0", 23 24 "knip": "^6.4.0", 24 25 "prettier": "^3.5.3", 25 26 "typescript": "^6.0.2", ··· 3767 3768 "jsonc-eslint-parser": ">=2.0.0" 3768 3769 } 3769 3770 }, 3771 + "node_modules/eslint-plugin-perfectionist": { 3772 + "version": "5.8.0", 3773 + "resolved": "https://registry.npmjs.org/eslint-plugin-perfectionist/-/eslint-plugin-perfectionist-5.8.0.tgz", 3774 + "integrity": "sha512-k8uIptWIxkUclonCFGyDzgYs9NI+Qh0a7cUXS3L7IYZDEsjXuimFBVbxXPQQngWqMiaxJRwbtYB4smMGMqF+cw==", 3775 + "dev": true, 3776 + "license": "MIT", 3777 + "dependencies": { 3778 + "@typescript-eslint/utils": "^8.58.0", 3779 + "natural-orderby": "^5.0.0" 3780 + }, 3781 + "engines": { 3782 + "node": "^20.0.0 || >=22.0.0" 3783 + }, 3784 + "peerDependencies": { 3785 + "eslint": "^8.45.0 || ^9.0.0 || ^10.0.0" 3786 + } 3787 + }, 3770 3788 "node_modules/eslint-plugin-prettier": { 3771 3789 "version": "5.5.5", 3772 3790 "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-5.5.5.tgz", ··· 5764 5782 "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", 5765 5783 "dev": true, 5766 5784 "license": "MIT" 5785 + }, 5786 + "node_modules/natural-orderby": { 5787 + "version": "5.0.0", 5788 + "resolved": "https://registry.npmjs.org/natural-orderby/-/natural-orderby-5.0.0.tgz", 5789 + "integrity": "sha512-kKHJhxwpR/Okycz4HhQKKlhWe4ASEfPgkSWNmKFHd7+ezuQlxkA5cM3+XkBPvm1gmHen3w53qsYAv+8GwRrBlg==", 5790 + "dev": true, 5791 + "license": "MIT", 5792 + "engines": { 5793 + "node": ">=18" 5794 + } 5767 5795 }, 5768 5796 "node_modules/node-exports-info": { 5769 5797 "version": "1.6.0",
+1
package.json
··· 45 45 "@e18e/eslint-plugin": "^0.3.0", 46 46 "eslint": "^10.0.3", 47 47 "eslint-plugin-package-json": "^0.91.0", 48 + "eslint-plugin-perfectionist": "^5.8.0", 48 49 "knip": "^6.4.0", 49 50 "prettier": "^3.5.3", 50 51 "typescript": "^6.0.2",
+1
source/assert-terminal-profile.js
··· 1 1 import ow from 'ow'; 2 + 2 3 import getTerminalProfiles from './get-terminal-profiles.js'; 3 4 4 5 /**
+1
source/get-terminal-default-profile.js
··· 1 1 import {execFile} from 'node:child_process'; 2 2 import {promisify} from 'node:util'; 3 3 import {runAppleScript} from 'run-applescript'; 4 + 4 5 import isTerminalRunning from './is-terminal-running.js'; 5 6 6 7 const execute = promisify(execFile);
+1 -1
source/get-terminal-profiles.js
··· 1 - import os from 'node:os'; 2 1 import {parseFile as parsePlistFile} from 'bplist-parser'; 2 + import os from 'node:os'; 3 3 4 4 /** 5 5 * @returns {Promise<string[]>} - List of installed profiles
+1
source/set-terminal-default-profile.js
··· 1 1 import {execFile} from 'node:child_process'; 2 2 import {promisify} from 'node:util'; 3 3 import {runAppleScript} from 'run-applescript'; 4 + 4 5 import assertTerminalProfile from './assert-terminal-profile.js'; 5 6 import isTerminalRunning from './is-terminal-running.js'; 6 7
+1
source/set-terminal-profile.js
··· 1 1 import {runAppleScript} from 'run-applescript'; 2 + 2 3 import assertTerminalProfile from './assert-terminal-profile.js'; 3 4 import isTerminalRunning from './is-terminal-running.js'; 4 5 import setTerminalDefaultProfile from './set-terminal-default-profile.js';
+2 -2
test/get-terminal-default-profile.js
··· 1 - import {beforeEach, describe, it, mock} from 'node:test'; 2 1 import assert from 'node:assert/strict'; 2 + import {beforeEach, describe, it, mock} from 'node:test'; 3 3 4 4 const childProcess = {execFile: mock.fn()}; 5 5 mock.module('node:child_process', {namedExports: childProcess}); ··· 35 35 isTerminalRunning.mock.mockImplementation(async () => false); 36 36 childProcess.execFile.mock.mockImplementation( 37 37 (_command, _args, callback) => { 38 - callback(null, {stdout: 'Profile\n', stderr: ''}); 38 + callback(null, {stderr: '', stdout: 'Profile\n'}); 39 39 }, 40 40 ); 41 41
+5 -3
test/get-terminal-profiles.js
··· 1 - import {beforeEach, describe, it, mock} from 'node:test'; 2 1 import assert from 'node:assert/strict'; 2 + import {beforeEach, describe, it, mock} from 'node:test'; 3 3 4 4 const os = {homedir: mock.fn(() => '/home')}; 5 - mock.module('node:os', {namedExports: os, defaultExport: os}); 5 + mock.module('node:os', {defaultExport: os, namedExports: os}); 6 6 7 7 const bplistParser = {parseFile: mock.fn()}; 8 8 mock.module('bplist-parser', {namedExports: bplistParser}); ··· 17 17 18 18 it('returns sorted profile names', async () => { 19 19 bplistParser.parseFile.mock.mockImplementation(async () => [ 20 - {'Window Settings': {'Light Profile': {}, 'Dark Profile': {}}}, 20 + {'Window Settings': {'Dark Profile': {}, 'Light Profile': {}}}, 21 21 ]); 22 22 23 23 const profiles = await getTerminalProfiles(); ··· 29 29 bplistParser.parseFile.mock.mockImplementation(async () => [ 30 30 { 31 31 'Window Settings': { 32 + /* eslint-disable perfectionist/sort-objects */ 32 33 'Profile 10': {}, 33 34 'Profile 2': {}, 34 35 'Profile 1': {}, 36 + /* eslint-enable */ 35 37 }, 36 38 }, 37 39 ]);
+3 -3
test/is-terminal-running.js
··· 1 - import {beforeEach, describe, it, mock} from 'node:test'; 2 1 import assert from 'node:assert/strict'; 2 + import {beforeEach, describe, it, mock} from 'node:test'; 3 3 4 4 const childProcess = {execFile: mock.fn()}; 5 5 mock.module('node:child_process', {namedExports: childProcess}); ··· 15 15 it('returns true when Terminal is running', async () => { 16 16 childProcess.execFile.mock.mockImplementation( 17 17 (_command, _args, callback) => { 18 - callback(null, {stdout: '1234\n', stderr: ''}); 18 + callback(null, {stderr: '', stdout: '1234\n'}); 19 19 }, 20 20 ); 21 21 ··· 49 49 it('calls pgrep with correct arguments', async () => { 50 50 childProcess.execFile.mock.mockImplementation( 51 51 (_command, _args, callback) => { 52 - callback(null, {stdout: '', stderr: ''}); 52 + callback(null, {stderr: '', stdout: ''}); 53 53 }, 54 54 ); 55 55
+2 -2
test/set-terminal-default-profile.js
··· 1 - import {beforeEach, describe, it, mock} from 'node:test'; 2 1 import assert from 'node:assert/strict'; 2 + import {beforeEach, describe, it, mock} from 'node:test'; 3 3 import {ArgumentError} from 'ow'; 4 4 5 5 const childProcess = {execFile: mock.fn()}; ··· 51 51 isTerminalRunning.mock.mockImplementation(async () => false); 52 52 childProcess.execFile.mock.mockImplementation( 53 53 (_command, _args, callback) => { 54 - callback(null, {stdout: '', stderr: ''}); 54 + callback(null, {stderr: '', stdout: ''}); 55 55 }, 56 56 ); 57 57
+1 -1
test/set-terminal-profile.js
··· 1 - import {beforeEach, describe, it, mock} from 'node:test'; 2 1 import assert from 'node:assert/strict'; 2 + import {beforeEach, describe, it, mock} from 'node:test'; 3 3 import {ArgumentError} from 'ow'; 4 4 5 5 const runAppleScript = mock.fn();