Skip to content
New issue

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

Support newest versions of eslint and eslint-parser #83

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 2 additions & 10 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
module.exports = {
extends: ['airbnb', 'prettier', 'prettier/react'],
parser: 'babel-eslint',
parserOptions: {
ecmaVersion: 2020,
// Can I remove these now?
ecmaFeatures: {
impliedStrict: true,
classes: true,
},
},
extends: ['airbnb', 'prettier'],
parser: '@babel/eslint-parser',
env: {
browser: true,
node: true,
Expand Down
42 changes: 21 additions & 21 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "eslint-config-wesbos",
"version": "1.0.1",
"version": "2.0.0",
"description": "ESLint and Prettier Config from Wes Bos",
"keywords": [
"javascript",
Expand All @@ -15,29 +15,29 @@
"author": "Wes bos <[email protected]>",
"license": "MIT",
"peerDependencies": {
"babel-eslint": "^10.1.0",
"eslint": "^7.8.1",
"eslint-config-airbnb": "^18.2.0",
"eslint-config-prettier": "^6.11.0",
"eslint-plugin-html": "^6.1.0",
"eslint-plugin-import": "^2.22.0",
"eslint-plugin-jsx-a11y": "^6.3.1",
"eslint-plugin-prettier": "^3.1.4",
"eslint-plugin-react": "^7.20.6",
"eslint-plugin-react-hooks": "^4.1.2",
"@babel/eslint-parser": "^7.13.14",
"eslint": "^7.24.0",
"eslint-config-airbnb": "^18.2.1",
"eslint-config-prettier": "^8.2.0",
"eslint-plugin-html": "^6.1.2",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-jsx-a11y": "^6.4.1",
"eslint-plugin-prettier": "^3.4.0",
"eslint-plugin-react": "^7.23.2",
"eslint-plugin-react-hooks": "^4.2.0",
"prettier": "^2.1.1"
},
"devDependencies": {
"babel-eslint": "^10.1.0",
"eslint": "^7.8.1",
"eslint-config-airbnb": "^18.2.0",
"eslint-config-prettier": "^6.11.0",
"eslint-plugin-html": "^6.1.0",
"eslint-plugin-import": "^2.22.0",
"eslint-plugin-jsx-a11y": "^6.3.1",
"eslint-plugin-prettier": "^3.1.4",
"eslint-plugin-react": "^7.20.6",
"eslint-plugin-react-hooks": "^4.1.2",
"@babel/eslint-parser": "^7.13.14",
"eslint": "^7.24.0",
"eslint-config-airbnb": "^18.2.1",
"eslint-config-prettier": "^8.2.0",
"eslint-plugin-html": "^6.1.2",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-jsx-a11y": "^6.4.1",
"eslint-plugin-prettier": "^3.4.0",
"eslint-plugin-react": "^7.23.2",
"eslint-plugin-react-hooks": "^4.2.0",
"prettier": "^2.1.1"
},
"scripts": {
Expand Down
24 changes: 19 additions & 5 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,22 +121,22 @@ Once you have done one, or both, of the above installs. You probably want your e
"editor.formatOnSave": true,
// turn it off for JS and JSX, we will do this via eslint
"[javascript]": {
"editor.formatOnSave": false
"editor.formatOnSave": false,
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
},
"[javascriptreact]": {
"editor.formatOnSave": false
"editor.formatOnSave": false,
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
},
// show eslint icon at bottom toolbar
"eslint.alwaysShowStatus": true,
// tell the ESLint plugin to run on save
"editor.codeActionsOnSave": {
"source.fixAll": true
},
// Optional BUT IMPORTANT: If you have the prettier extension enabled for other languages like CSS and HTML, turn it off for JS since we are doing it through Eslint already
"prettier.disableLanguages": ["javascript", "javascriptreact"],
```

After attempting to lint your file for the first time, you may need to click on 'ESLint' in the bottom right and select 'Allow Everywhere' in the alert window.
After attempting to lint your file for the first time, you may need to click on 'ESLint' in the bottom right and select 'Allow Everywhere' in the alert window.

Finally you'll usually need to restart VS code. They say you don't need to, but it's never worked for me until I restart.

Expand Down Expand Up @@ -204,3 +204,17 @@ To do the above for local, omit the `--global` flag.
Then if you are using a local install, remove your `package-lock.json` file and delete the `node_modules/` directory.

Then follow the above instructions again.

### Parsing error: No Babel config file detected for filename

You'll need to create a default `babel.config.js` file in the root of your project. See https://github.com/standard/vscode-standard/issues/100#issuecomment-686435590 for more information

To make this work with previous babelrc files you may have you can add a simple `babel.config.js` of:

```js
module.exports = {
babelrcRoots: [
"."
]
};
```