Conversation
I'll ignore for now. Eslint should resolve it soon, and Storybook should follow |
|
@luca-gr4vy ok, then I would just create a ticket for those ignored vulnerabilities and that's all by me about it 👍 |
GiordanoArman
left a comment
There was a problem hiding this comment.
Same as the other project, when I run the linter I get
fido@Mac gr4vy-embed % yarn lint
yarn run v1.22.22
$ lerna run lint
lerna notice cli v9.0.0
Lerna (powered by Nx) Running target lint for 3 projects
✖ @gr4vy/embed:lint
$ eslint src/ --ext ts
Invalid option '--ext' - perhaps you meant '-c'?
You're using eslint.config.js, some command line flags are no longer available. Please see https://eslint.org/docs/latest/use/command-line-interface for details.
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
Lerna (powered by Nx) Ran target lint for 3 projects (2s)
✔ 0/1 succeeded [0 read from cache]
✖ 1/1 targets failed, including the following:
- @gr4vy/embed:lint
error Command failed with exit code 130.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
GiordanoArman
left a comment
There was a problem hiding this comment.
We are not using .eslintignore and .eslintrc.js anymore right?
eslint.config.js
Outdated
|
|
||
| module.exports = defineConfig([ | ||
| { | ||
| extends: fixupConfigRules( |
There was a problem hiding this comment.
AI is telling me that fixupConfigRules should be used like this, not sure though
module.exports = defineConfig([
// 1. Spread the migrated "extends" configs into the array
...fixupConfigRules(
compat.extends(
'eslint:recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:react/recommended',
'plugin:prettier/recommended',
'plugin:import/errors',
'plugin:import/warnings',
'plugin:import/typescript'
)
),
couldn't figure out why you had that, but I changed it to something that should work across the board 6c89f6d |
| }, | ||
|
|
||
| { | ||
| files: ['**/*.{spec,test}.{ts,tsx}'], |
There was a problem hiding this comment.
separate, so it is only applied to test files
|
|
||
| { | ||
| settings: { | ||
| 'import/resolver': { |
There was a problem hiding this comment.
to resolve aliases based on tsconfig
| const eslintPluginPrettierRecommended = require('eslint-plugin-prettier/recommended') | ||
| const reactPlugin = require('eslint-plugin-react') | ||
| const storybook = require('eslint-plugin-storybook') | ||
| const globals = require('globals') |
There was a problem hiding this comment.
eslint 9 doesn't support env: to set the globals anymore, so we need the globals package (if we're not hardcoding all the globals we need). See https://eslint.org/docs/latest/use/configure/language-options#predefined-global-variables
|
@GiordanoArman I moved too fast and just migrated using eslint compat. Since all the plugins we use support flat configs, I just moved to using a pure flat config which is cleaner and more in line with modern ESLint tooling (even when we'll upgrade to v10). I will upgrade the secure-fields one too |
There was a problem hiding this comment.
I get this error now
fido@Mac gr4vy-embed % yarn lint
yarn run v1.22.22
$ lerna run lint
lerna notice cli v9.0.0
Lerna (powered by Nx) Running target lint for 3 projects
✖ @gr4vy/embed:lint
$ eslint src/**/*.ts
Oops! Something went wrong! :(
ESLint: 8.57.1
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './config' is not defined by "exports" in /Users/fido/Documents/GitHub/gr4vy-embed/node_modules/eslint/package.json
at exportsNotFound (node:internal/modules/esm/resolve:314:10)
at packageExportsResolve (node:internal/modules/esm/resolve:661:9)
at resolveExports (node:internal/modules/cjs/loader:661:36)
at Function._findPath (node:internal/modules/cjs/loader:753:31)
at Function._resolveFilename (node:internal/modules/cjs/loader:1391:27)
at defaultResolveImpl (node:internal/modules/cjs/loader:1061:19)
at resolveForCJSWithHooks (node:internal/modules/cjs/loader:1066:22)
at Function._load (node:internal/modules/cjs/loader:1215:37)
at TracingChannel.traceSync (node:diagnostics_channel:322:14)
at wrapModuleLoad (node:internal/modules/cjs/loader:235:24)
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
Lerna (powered by Nx) Ran target lint for 3 projects (1s)
✔ 0/1 succeeded [0 read from cache]
✖ 1/1 targets failed, including the following:
- @gr4vy/embed:lint
have you run |
Description
Upgrades to ESLint v9.
.eslintrc.jsfiles in sub-folders)prettier --writeand update a few files under embed/srcChecklist
yarn lintto make sure my changes pass all testsyarn testto make sure my changes pass all lintersmainbranchI have tested both the react and the CDN versions on local and integration environmentsI have added the necessary labels to this PR in case a new release needs to be published after merging intomain(e.g.releaseandpatch)Contribution guidelines
For contribution guidelines, styleguide, and other helpful information please
see the
CONTRIBUTING.mdfile in the root of this project.