JavaScript Linter

General discussion for players of Oolite.

Moderators: winston, another_commander

User avatar
hiran
Theorethicist
Posts: 2410
Joined: Fri Mar 26, 2021 1:39 pm
Location: a parallel world I created for myself. Some call it a singularity...

Re: JavaScript Linter

Post by hiran »

Cholmondely wrote: Wed Jan 24, 2024 6:22 pm
I already had node (from dismal attempts at mastering javascript).

I got this:

Command inside AppleMac's "Terminal":

Code: Select all

npm init @eslint/config
resulted in all sorts of on-going fun and games culminating in this:

Code: Select all

npx: installed 43 in 30.559s
file:///~/~/.npm/_npx/46428/lib/node_modules/@eslint/create-config/lib/init/config-initializer.js:400
        throw new Error("A package.json file is necessary to initialize ESLint. Run `npm init` to create a package.json file and try again.");
              ^

Error: A package.json file is necessary to initialize ESLint. Run `npm init` to create a package.json file and try again.
    at promptUser (file:///~/~/.npm/_npx/46428/lib/node_modules/@eslint/create-config/lib/init/config-initializer.js:400:15)
    at initializeConfig (file:///~/~/.npm/_npx/46428/lib/node_modules/@eslint/create-config/lib/init/config-initializer.js:616:12)
    at file:///~/~/.npm/_npx/46428/lib/node_modules/@eslint/create-config/bin/create-config.js:10:1
    at ModuleJob.run (internal/modules/esm/module_job.js:146:23)
    at async Loader.import (internal/modules/esm/loader.js:165:24)
    at async Object.loadESM (internal/process/esm_loader.js:68:5)
I can see you ran `npm init @eslint/config`.
Now what output do you get from `npm init` running in the same directory?
Sunshine - Moonlight - Good Times - Oolite
User avatar
Cholmondely
Archivist
Archivist
Posts: 5381
Joined: Tue Jul 07, 2020 11:00 am
Location: The Delightful Domains of His Most Britannic Majesty (industrial? agricultural? mainly anything?)
Contact:

Re: JavaScript Linter

Post by Cholmondely »

hiran wrote: Wed Jan 24, 2024 10:40 pm
I can see you ran `npm init @eslint/config`.
Now what output do you get from `npm init` running in the same directory?


1) Before trying all this, I had a stab at the OXP Verifier.

Using the 1.90 Verifier resulted in odd messages about XML (the .js script & the OpenStep .plist I was checking had nothing about XML in either, so I presume it was more to do with the 1.90 Verifier).

Using the 1.91 Verifier resulted in just as little information as I get in my lastest.log - I presume that that too uses OXP Verifier.



2) Then another stab at ATOM

I then ran them both through ATOM. No joy with the .js script, but chunks of the .plist appeared in red! And I had just enough smatterings of knowledge to fix them! I rather amazed myself...

So the desperate need for a .plist linter might just be over! (No joy yet with XML .plists, though, and I seem to be getting error messages about the shipdata.plist in The Assassins Guild which is in XML).



3) "npm init" yielded this:

Code: Select all

gubbins ~ % npm init
This utility will walk you through creating a package.json file.
It only covers the most common items, and tries to guess sensible defaults.

See `npm help init` for definitive documentation on these fields and exactly what they do.

Use `npm install <pkg>` afterwards to install a package and save it as a dependency in the package.json file.

Press ^C at any time to quit.
package name: (gubbins) 

And, if it is relevant, I got the following message when I first expanded the node.js package:

Code: Select all

This package will install:
	•	Node.js v14.15.1 to /usr/local/bin/node
	•	npm v6.14.8 to /usr/local/bin/npm
Comments wanted:
Missing OXPs? What do you think is missing?
Lore: The economics of ship building How many built for Aronar?
Lore: The Space Traders Flight Training Manual: Cowell & MgRath Do you agree with Redspear?
Post Reply