Comments (5)
Thank you for sharing the repository. I looked it up.
It seems that the parser configured with eslint-config-next
is being used.
As you did, if you put plugin: jsonc/recommended-with-jsonc
at the end of extends
will cause the .json
file to select the json parser.
If you don't want to change the order of extends
, you need to add parser settings.
https://ota-meshi.github.io/eslint-plugin-jsonc/user-guide/#parser-configuration
from eslint-plugin-jsonc.
It's not on github yet, I'll push it within a few days when I've set up some things.
from eslint-plugin-jsonc.
Thanks for looking into it.
I think I'd rather add parser configuration. Messing with plugin order theoretically shouldn't matter, but in practice it sometimes does matter. It might be helpful for future users to add a paragraph about Next.js to the documentation describing how to prevent this issue.
from eslint-plugin-jsonc.
Thank you for posting issue.
I don't know the cause of your problem. Can you share your repository that can reproduce the problem?
from eslint-plugin-jsonc.
And here's a simplified reproduction repo:
https://github.com/thany/jsonc-error-repro
If I did it right, here's how to reproduce:
- Checkout the repo
- Run
npm i
on it - Install eslint globally:
npm i -g eslint
- Run it against the test.json:
eslint test.json
Unfortunately, Next.js's built-in lint command doesn't test that file. Don't know why, and it doesn't matter. But that the only reason you'll need eslint available as a CLI command.
I did some further testing myself, and it seems removing next
from the extend
array makes the error go away. But I really need that one in there, because of the nature of the project.
Also when I move plugin:jsonc/recommended-with-jsonc
to the end of the extend
array, the error also goes away. But that too seems only a temporary workaround: let's say I wanted to include another plugin, which also needs to be last in the list. There can be only one last.
from eslint-plugin-jsonc.
Related Issues (20)
- Adding no-duplicate-values-in-json files rule feature to the plugin HOT 14
- Allow ignoring certain paths from sorting HOT 3
- Error importing this plugin in Vite application HOT 2
- Add only allow flattened/nested keys rule HOT 1
- Request textDocument/codeAction failed. HOT 1
- "jsonc/no-comments" regra - Há um bug que Comentário no início do bloco é igno
- "jsonc/no-comments" rule - [bug] some comments are ignored HOT 2
- Support configuration file eslint.config.js HOT 1
- Conflict with @typescript-eslint/recommended-requiring-type-checking? HOT 1
- vscode-eslint extension cannot validate JSON using the "eslint.probe" configuration HOT 4
- Question: vscode and JSON5 syntax highlight HOT 2
- sort-keys need to run many times to sort big files HOT 4
- sort-keys: Misplaced comments in tsconfig.json HOT 1
- Internal code suggestion: add explicit call signatures for RuleListener node types? HOT 1
- Keep getting "Parsing error: Expected to be an expression, but got empty" HOT 7
- Error: Cannot find module 'espree'
- Struggling to get plugin to work with typescript parser... HOT 2
- Version 3 HOT 1
- typescript gives an error saying `synckit` is an ESM package, but `synckit` can also be used with commonjs. I don't quite understand the correct way to configure typescript 😓
- How config correctly my eslint config with jsonc 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 eslint-plugin-jsonc.