chore: Fix a couple of regex related eslint issues

/puter/packages/phoenix/src/puter-shell/providers/ScriptCommandProvider.js
  27:38  error  Unnecessary escape character: \/  no-useless-escape

/puter/packages/phoenix/src/util/wrap-text.js
  24:33  error  Unexpected control character(s) in regular expression: \x1b  no-control-regex
This commit is contained in:
Sam Atkins 2024-05-01 11:32:18 +01:00
parent c8a20cadbf
commit 96e9c154bd
2 changed files with 3 additions and 1 deletions

View File

@ -24,7 +24,7 @@ export class ScriptCommandProvider {
async lookup (id, { ctx }) {
const { filesystem } = ctx.platform;
const is_path = id.match(/^[.\/]/);
const is_path = id.match(/^[./]/);
if ( ! is_path ) return undefined;
const absPath = resolveRelativePath(ctx.vars, id);

View File

@ -16,6 +16,8 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
/* eslint-disable no-control-regex */
export function lengthIgnoringEscapes(text) {
const escape = '\x1b';
// There are a lot of different ones, but we only use graphics-mode ones, so only parse those for now.