Git Product home page Git Product logo

Comments (13)

andiz2 avatar andiz2 commented on August 21, 2024 1

Hi @buffalojoec I can take care of this.
Would take a look at migration guide and come back with updates. 😄

from solana-program-library.

buffalojoec avatar buffalojoec commented on August 21, 2024 1

@andiz2 Thank you!!

from solana-program-library.

buffalojoec avatar buffalojoec commented on August 21, 2024 1

@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.

buffalojoec avatar buffalojoec commented on August 21, 2024 1

I don't think spl-account-compression has ever been passing lint. It looks like we skip it in CI.

# pnpm lint # re-enable when lints are fixed

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.

steveluscher avatar steveluscher commented on August 21, 2024 1

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.

buffalojoec avatar buffalojoec commented on August 21, 2024 1

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.

Yeah I definitely didn't want to upgrade to 9 without using flat config.

from solana-program-library.

13550501 avatar 13550501 commented on August 21, 2024

That is wonderfull.

from solana-program-library.

andiz2 avatar andiz2 commented on August 21, 2024

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.

andiz2 avatar andiz2 commented on August 21, 2024

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.

andiz2 avatar andiz2 commented on August 21, 2024

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.

andiz2 avatar andiz2 commented on August 21, 2024

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.

steveluscher avatar steveluscher commented on August 21, 2024

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.

andiz2 avatar andiz2 commented on August 21, 2024

I'll put this on hold until further news

from solana-program-library.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.