This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| javascript:eslint-for-nodejs [2021-03-07] – ↷ Page name changed from javascript:eslint to javascript:eslint-for-nodejs dcai | javascript:eslint-for-nodejs [2021-10-01] (current) – dcai | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | < | + | < |
| + | npm init -y | ||
| npx mrm gitignore prettier jest | npx mrm gitignore prettier jest | ||
| - | npx install-peerdeps | + | npm i -D @babel/core babel-jest @babel/ |
| - | npm i -D eslint-config-prettier eslint-plugin-prettier | + | npm i -D eslint-config-prettier eslint-plugin-prettier |
| - | npm i -D @babel/ | + | npm i -D @babel/ |
| </ | </ | ||
| - | < | + | < |
| module.exports = { | module.exports = { | ||
| - | parser: 'babel-eslint', | + | parser: '@babel/eslint-parser', |
| + | | ||
| + | sourceType: ' | ||
| + | requireConfigFile: | ||
| + | }, | ||
| + | // babelOptions: | ||
| + | // | ||
| + | // }, | ||
| env: { | env: { | ||
| commonjs: true, | commonjs: true, | ||
| Line 17: | Line 24: | ||
| browser: true, | browser: true, | ||
| }, | }, | ||
| - | extends: [' | + | extends: ["plugin: |
| - | plugins: [' | + | |
| rules: { | rules: { | ||
| - | ' | ||
| ' | ' | ||
| ' | ' | ||
| Line 28: | Line 33: | ||
| </ | </ | ||
| - | < | + | < |
| module.exports = { | module.exports = { | ||
| $schema: ' | $schema: ' | ||
| arrowParens: | arrowParens: | ||
| printWidth: 88, | printWidth: 88, | ||
| + | useTabs: false, | ||
| singleQuote: | singleQuote: | ||
| tabWidth: 2, | tabWidth: 2, | ||
| Line 48: | Line 54: | ||
| </ | </ | ||
| - | < | + | < |
| [*.{js,ts}] | [*.{js,ts}] | ||
| charset = utf-8 | charset = utf-8 | ||
| indent_style = space | indent_style = space | ||
| indent_size = 2 | indent_size = 2 | ||
| + | |||
| + | [git/ | ||
| + | indent_style = tab | ||
| [Makefile] | [Makefile] | ||
| Line 62: | Line 71: | ||
| </ | </ | ||
| - | < | + | < |
| { | { | ||
| { | { | ||
| - | " | ||
| - | " | ||
| - | ], | ||
| " | " | ||
| " | " | ||
| Line 79: | Line 85: | ||
| </ | </ | ||
| - | < | + | < |
| + | |||
| + | 'use strict'; | ||
| + | |||
| + | module.exports = function (api) { | ||
| + | api.cache(true); | ||
| + | |||
| + | const envOpts = { | ||
| + | modules: ' | ||
| + | targets: { | ||
| + | node: ' | ||
| + | } | ||
| + | }; | ||
| + | const presets = [[' | ||
| + | const plugins = []; | ||
| + | |||
| + | return { | ||
| + | presets, | ||
| + | plugins | ||
| + | }; | ||
| + | }; | ||
| - | { | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | } | ||
| - | } | ||
| - | } | ||
| </ | </ | ||