Comments (13)
Hi @buffalojoec I can take care of this.
Would take a look at migration guide and come back with updates. 😄
from solana-program-library.
@andiz2 Thank you!!
from solana-program-library.
@andiz2 What caused this originally? You shouldn't need to mess with Cargo to work with JS, unless you're trying to run the e2e tests, which aren't really necessary for testing the linter. Ideally you just need to get pnpm lint
working.
In any case, your solana CLI version is out-of-date. cargo build-sbf
uses the Solana-forked rustc
compiler and whatever CLI version you're running has rustc 1.680-dev
. Try upgrading your CLI to 1.18
.
from solana-program-library.
I don't think spl-account-compression
has ever been passing lint. It looks like we skip it in CI.
I've added a PR to update this! #6613
There's some more linting issues I noticed. For example, some packages (like name-service
) don't ignore the lib
directory when linting. I've also added a PR for this! #6614
from solana-program-library.
I took a crack at this today:
// ./libraries/type-length-value/js/eslint.config.cjs
const js = require('@eslint/js');
const PrettierPlugin = require('eslint-plugin-prettier');
const TypeScriptPlugin = require('@typescript-eslint/eslint-plugin');
const TypeScriptParser = require('@typescript-eslint/parser');
const RequireExtensionsPlugin = require('eslint-plugin-require-extensions');
/** @type {import('eslint').Linter.FlatConfig[]} */
module.exports = [
js.configs.recommended,
TypeScriptPlugin.configs.recommended,
PrettierPlugin.configs.recommended,
RequireExtensionsPlugin.configs.recommended,
{
ignores: ['docs', 'lib', 'test-ledger', 'package-lock.json'],
languageOptions: {
parser: TypeScriptParser,
},
plugins: {
'@typescript-eslint': TypeScriptPlugin,
prettier: PrettierPlugin,
'require-extensions': RequireExtensionsPlugin,
},
rules: {
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/no-empty-interface': 'off',
'@typescript-eslint/consistent-type-imports': 'error',
},
},
{
files: ['examples/**/*', 'test/**/*'],
rules: {
'require-extensions/require-extensions': 'off',
'require-extensions/require-index': 'off',
},
},
];
Until all of the plugins (@typescript-eslint
, Prettier, require-extensions-eslint-plugin
) are updated for ESLint 9, this project is dead in the water.
from solana-program-library.
I mean, I guess we could just set
ESLINT_USE_FLAT_CONFIG
tofalse
and punt it down the road, but we'd be toast once ESLint 10 comes around.
Yeah I definitely didn't want to upgrade to 9 without using flat config.
from solana-program-library.
That is wonderfull.
from solana-program-library.
Currently struggleing with the build..
Seems to be some dependency issues but I already updated rustc
beast@DESKTOP-TFSG0II:/mnt/c/Users/admin/Documents/code js/spl-fork/solana-program-library$ cargo build-sbf
error: package solana-program v1.18.2
cannot be built because it requires rustc 1.72.0 or newer, while the currently active rustc version is 1.68.0-dev
Either upgrade to rustc 1.72.0 or newer, or use
cargo update -p [email protected] --precise ver
where ver
is the latest version of solana-program
supporting rustc 1.68.0-dev
beast@DESKTOP-TFSG0II:/mnt/c/Users/admin/Documents/code js/spl-fork/solana-program-library$ rustup update
info: syncing channel updates for 'stable-x86_64-unknown-linux-gnu'
info: syncing channel updates for 'nightly-x86_64-unknown-linux-gnu'
info: checking for self-update
stable-x86_64-unknown-linux-gnu unchanged - rustc 1.77.2 (25ef9e3d8 2024-04-09)
nightly-x86_64-unknown-linux-gnu unchanged - rustc 1.79.0-nightly (1cec373f6 2024-04-16)
info: cleaning up downloads & tmp directories
beast@DESKTOP-TFSG0II:/mnt/c/Users/admin/Documents/code js/spl-fork/solana-program-library$ rustc --version
rustc 1.77.2 (25ef9e3d8 2024-04-09)
beast@DESKTOP-TFSG0II:/mnt/c/Users/admin/Documents/code js/spl-fork/solana-program-library$ cargo --version
cargo 1.77.2 (e52e36006 2024-03-26)
beast@DESKTOP-TFSG0II:/mnt/c/Users/admin/Documents/code js/spl-fork/solana-program-library$ cargo clean
Removed 0 files
beast@DESKTOP-TFSG0II:/mnt/c/Users/admin/Documents/code js/spl-fork/solana-program-library$ cargo build-sbf
error: package toml_edit v0.21.1
cannot be built because it requires rustc 1.69 or newer, while the currently active rustc version is 1.68.0-dev
Either upgrade to rustc 1.69 or newer, or use
cargo update -p [email protected] --precise ver
where ver
is the latest version of toml_edit
supporting rustc 1.68.0-dev
beast@DESKTOP-TFSG0II:/mnt/c/Users/admin/Documents/code js/spl-fork/solana-program-library$ cargo update -p toml_edit --precise ver
error: invalid version format for precise version ver
Caused by:
unexpected character 'v' while parsing major version number
beast@DESKTOP-TFSG0II:/mnt/c/Users/admin/Documents/code js/spl-fork/solana-program-library$ cargo update -p toml_edit@
-bash: syntax error near unexpected token newline' beast@DESKTOP-TFSG0II:/mnt/c/Users/admin/Documents/code js/spl-fork/solana-program-library$ cargo update -p toml_edit@<version> -bash: syntax error near unexpected token
newline'
beast@DESKTOP-TFSG0II:/mnt/c/Users/admin/Documents/code js/spl-fork/solana-program-library$ cargo update -p [email protected]
error: package ID specification [email protected]
did not match any packages
Did you mean `toml_edit`?
from solana-program-library.
I will ignore Cargo and make pnpm lint work for the new version. If I'll have further Q I'll let you know.
from solana-program-library.
I've used pnpm lint
with the current version and I've encountered some issues..
`@solana/spl-account-compression:lint: + eslint . --ext .js,.ts
@solana/spl-account-compression:lint:
@solana/spl-account-compression:lint: /mnt/c/Users/admin/Documents/code js/spl-fork/solana-program-library/account-compression/sdk/src/constants/index.ts
@solana/spl-account-compression:lint: 13:5 error Expected interface keys to be in ascending order. 'maxBufferSize' should be before 'maxDepth' typescript-sort-keys/interface
@solana/spl-account-compression:lint: 64:22 error Expected interface keys to be in ascending order. 'maxBufferSize' should be before 'maxDepth' typescript-sort-keys/interface
@solana/spl-account-compression:lint: 65:22 error Expected interface keys to be in ascending order. 'maxBufferSize' should be before 'maxDepth' typescript-sort-keys/interface
@solana/spl-account-compression:lint: 66:22 error Expected interface keys to be in ascending order. 'maxBufferSize' should be before 'maxDepth' typescript-sort-keys/interface
@solana/spl-account-compression:lint: 67:22 error Expected interface keys to
@solana/spl-account-compression:lint: /mnt/c/Users/admin/Documents/code js/spl-fork/solana-program-library/account-compression/sdk/src/generated/instructions/append.ts
@solana/spl-account-compression:lint: 47:5 error Expected interface keys to be in ascending order. 'authority' should be before 'merkleTree' typescript-sort-keys/interface
@solana/spl-account-compression:lint: 49:5 error Expected interface keys to be in ascending order. 'anchorRemainingAccounts' should be before 'noop' typescript-sort-keys/interface
@solana/spl-account-compression:lint:
@solana/spl-account-compression:lint: /mnt/c/Users/admin/Documents/code js/spl-fork/solana-program-library/account-compression/sdk/src/generated/instructions/closeEmptyTree.ts
@solana/spl-account-compression:lint: 31:5 error Expected interface keys to be in ascending order. 'authority' should be before 'merkleTree' typescript-sort-keys/interface
@solana/spl-account-compression:lint: 33:5 error Expected interface keys to be in ascending order. 'anchorRemainingAccounts' should be before 'recipient' typescript-sort-keys/interface
@solana/spl-account-compression:lint:
@solana/spl-account-compression:lint: /mnt/c/Users/admin/Documents/code js/spl-fork/solana-program-library/account-compression/sdk/src/generated/instructions/initEmptyMerkleTree.ts
@solana/spl-account-compression:lint: 18:5 error Expected interface keys to be in ascending order. 'maxBufferSize' should be before 'maxDepth' typescript-sort-keys/interface
@solana/spl-account-compression:lint: 49:5 error Expected interface keys to be in ascending order. 'authority' should be before 'merkleTree' `
Am I doing something wrong?
from solana-program-library.
From what I've researched lately SPL have this ESLint config dependency: "@solana/eslint-config-solana": "^3.0.3",
and package.json of this config https://github.com/solana-labs/eslint-config-solana/blob/main/package.json
uses eslint 8.45.0..
...btw..
I am still curious why when I've ran pnpm lint on the actual code it brings lots of errors...
#6562 (comment)
from solana-program-library.
I mean, I guess we could just set ESLINT_USE_FLAT_CONFIG
to false
and punt it down the road, but we'd be toast once ESLint 10 comes around.
from solana-program-library.
I'll put this on hold until further news
from solana-program-library.
Related Issues (20)
- Customized token gas fee
- `2.0.0` `solana-program` release causing issues due to `<=2.0.0` on patch upgrades. HOT 26
- Question/Bug: Solana 1.18.17 crates don't build | Spl-pod 0.1.0 needed for older version of solana HOT 6
- Question (Bug?): Upgrade of @solana/spl-token from 0.4.6->0.4.7 throws ERR_REQUIRE_ESM error HOT 4
- createMint Throwing TypeError: Cannot read properties of null (reading 'toBuffer') HOT 2
- Feature: Allow permanent delegate to close ata's for mint HOT 2
- @solana/[email protected] causing ESM import errors HOT 1
- Issue: `invoke_transfer_checked` failed with out of memory for 2 transfers with hook HOT 7
- getOrCreateAssociatedTokenAccount throws error despite payer has enough SOL and account exists already. HOT 1
- token-cli: `set-transfer-fee` has different granularity than `create-token` HOT 5
- token-cli: withdraw-withheld-tokens silently fails HOT 6
- Install spl-token-cli v4.0.0 failed HOT 7
- token-cli: Unable to use the token cli to transfer tokens that have the transfer-fee and transfer-hook extensions. HOT 2
- Feature Request: Use `u64` for Token-Group Interface `max_size` HOT 3
- Issue: Cannot Figure Out SDK Instruction HOT 1
- `?` couldn't convert the error to `solana_program::program_error::ProgramError` HOT 3
- Token Swap Error: The provided token program does not match the expected token program for the swap. HOT 1
- Suggestion: use default prettier settings HOT 1
- Feature request: add optional media to the TokenMetadata type HOT 1
- Unable to get a tokens metadata for token 2022 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from solana-program-library.