We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I created package with own rules where I use stylistic with next/recommended
// eslin-plugin-test/index.js module.exports = { configs: { nextjs: { plugins: ["@stylistic"], extends: ["plugin:@next/next/recommended"], rules: { "@stylistic/max-len": ["error", 120], }, }, }, };
Then I use it in my NextJS project
// nextproject/.eslintrc.js /** @type {import('eslint').Linter.Config} */ module.exports = { root: true, extends: ['plugin:@test/test/nextjs'], parserOptions: { project: './tsconfig.json', ecmaVersion: 'latest', }, env: { es6: true, node: true, }, };
The problem is that every rule added into rules in index.js file causes an error:
[Error - 18:41:35] TypeError: Cannot read properties of undefined (reading 'lines') Occurred while linting /Users/silon/Developer/nextjs-template/.eslintrc.js:2 Rule: "@stylistic/max-len" at checkProgramForMaxLength
The problem in this case is in max-len.js file in this line:
max-len.js
function checkProgramForMaxLength(node) { // split (honors line-ending) const lines = sourceCode.lines;
When I remove max-len rule from index.js eslint works good
The text was updated successfully, but these errors were encountered:
Hi @Silon. I think you need to use ESLint v8.40 or newer. New those properties were added in v8.40.
https://eslint.org/blog/2023/05/eslint-v8.40.0-released
Sorry, something went wrong.
@ota-meshi you're right! In my library I got newest but project had old version. Thank you
No branches or pull requests
I created package with own rules where I use stylistic with next/recommended
Then I use it in my NextJS project
The problem is that every rule added into rules in index.js file causes an error:
The problem in this case is in
max-len.js
file in this line:When I remove max-len rule from index.js eslint works good
The text was updated successfully, but these errors were encountered: