Comments (6)
Also getting this issue with eslint 8.11.0
, prettier 2.2.1
and prettier-atom 0.60.1
and using TypeScript (in case it matters).
However, if I uncheck ESLint Integration
in prettier-atom config, then it works and the prettier rules take effect normally.
from prettier-atom.
@M1CK431 are you using prettier-eslint with prettier-atom? This should already be working fine if you are not. If you are, the error you are getting is because prettier-eslint is not eslint 8 compatible (yet). See: prettier/prettier-eslint#656
I would highly recommend, however, that you drop using prettier-eslint in your projects and instead use https://github.com/prettier/eslint-config-prettier and https://github.com/prettier/eslint-plugin-prettier to just have eslint run your formatting.
from prettier-atom.
Hi @robwise, sorry for my late reply.
Here is my dev dependencies (from package.json
):
{
"devDependencies": {
"@babel/core": "^7.12.16",
"@babel/eslint-parser": "^7.12.16",
"@vue/cli-plugin-babel": "~5.0.0-rc.1",
"@vue/cli-plugin-eslint": "~5.0.0-rc.1",
"@vue/cli-plugin-router": "~5.0.0-rc.1",
"@vue/cli-service": "~5.0.0-rc.1",
"autoprefixer": "^10.4.0",
"eslint": "^8.10.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-vue": "^8.0.3",
"naive-ui": "^2.21.4",
"postcss": "^8.4.4",
"prettier": "^2.4.1",
"tailwindcss": "^3.0.0"
}
}
As you can see, there isn't prettier-eslint
installed and even I have check in my node-modules
directory (just in case of indirect dependency) and I haven't found any prettier-eslint
entry:
ls -l node_modules/prettier-eslint
ls: cannot access 'node_modules/prettier-eslint': No such file or directory
In addition, eslint-config-prettier
and eslint-plugin-prettier
are both already installed.
In Atom, I'm using prettier-atom
v0.60.1 with the following settings:
EDIT: here is my .eslintrc.js
module.exports = {
root: true,
env: { node: true },
extends: [
"plugin:vue/vue3-essential",
"eslint:recommended",
"plugin:prettier/recommended"
],
parserOptions: { parser: "@babel/eslint-parser" },
rules: {
"prettier/prettier": [
"warn",
{ trailingComma: "none", arrowParens: "avoid" }
],
"vue/multi-word-component-names": "off",
"no-console": process.env.NODE_ENV === "production" ? "warn" : "off",
"no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off"
}
};
Any idea? 🥺
from prettier-atom.
up! @robwise 🙏 🙃
from prettier-atom.
Sharing in case it helps. I created a brand new folder with nothing in it and ran npm init
, pressing Enter
to select all of the defaults.
I then added a prettier.config.js
with the following:
module.exports = {
arrowParens: 'always',
semi: false,
singleQuote: true,
trailingComma: 'es5',
}
Making any modification that would trigger one of the formatting rules would cause prettier-atom
to re-format the file as expected.
I then added a .eslintrc.js
file with the following:
module.exports = {
extends: []
}
Making simple formatting changes to this file caused prettier-atom
to re-format the file as expected.
I then added eslint
via npm add -D eslint
which caused npm
to install ESLint ^8.17.0
.
I then attempted to make a formatting change to both of the above files and each time was presented with a prettier-atom failed: CLIEngine is not a constructor
error:
Downgrading eslint
to v7.32.0 and restarting Atom seems to "fix" the issue in that formatting is run as expecting along with no error message.
This is with prettier-atom
v0.60.1 which appears to install eslint
v5? 🤷
[email protected] ~/.atom/packages/prettier-atom
└─┬ @lewisl9029/[email protected]
└── [email protected]
from prettier-atom.
@robwise premature close. prettier-eslint was updated and this issue still occurs.
from prettier-atom.
Related Issues (20)
- Provide Feedback About Configuration in Use
- scss support
- Use latest version of prettier-eslint
- "prettier-atom failed: Cannot find module" with shared config HOT 3
- prettier-atom failed: The "path" argument must be of type string. Received type undefined HOT 1
- Option to disable if there is no local prettier config/version HOT 2
- Fallback to root-level configuration for nested packages
- prettier-atom failed: Failed to load plugin 'react-hooks' declared in 'CLIOptions': The argument 'filename' must be a file URL object, file URL string, or absolute path string. Received ''
- Installing “[email protected]” failed HOT 2
- Uncaught Error: Cannot find module './config-schema.json'Require stack:- $ATOM_HOME/packages\pr... HOT 1
- prettier-atom failed: The "path" argument must be of type string. Received type undefined | This is on Mac HOT 3
- Change from prettier-stylelint to stylelint-prettier
- PrettierRC Config file not reloaded on change HOT 1
- Uncaught Error: Cannot find module './third-party.js' HOT 3
- Prettier: Format locks Atom up HOT 6
- Prettier ignores .prettierrc rules located in root project folder. HOT 2
- Can't install prettier-atom HOT 2
- setting max line on prettier, to make result better HOT 1
- js comment causes error HOT 6
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 prettier-atom.