Skip to content

Latest commit

 

History

History
68 lines (42 loc) · 2.42 KB

README.ru.md

File metadata and controls

68 lines (42 loc) · 2.42 KB

Google Apps Script Eslint окружение

Translations

Установка

$> git clone https://github.com/gasru/google-apps-script-eslint-env.git
$> npm i
$> npm run run-fix

< [email protected] run-fix /raid/user/gasru/google-apps-script-eslint-env
< npm run demo && npm run lint-fix && exit 0


< [email protected] demo /raid/user/gasru/google-apps-script-eslint-env
< rm src/*.* && cp demo/*.js src/


< [email protected] lint-fix /raid/user/gasru/google-apps-script-eslint-env
< eslint --fix src/


/raid/user/gasru/google-apps-script-eslint-env/src/Code.js
   8:10  error  'tryToMakeDocFile' is defined but never used  no-unused-vars
  20:12  error  Unexpected constant condition                 no-constant-condition
  21:13  error  'par' is assigned a value but never used      no-unused-vars

✖ 3 problems (3 errors, 0 warnings)

Установка поверх проекта

$> npm i -D @types/google-apps-script eslint eslint-config-google eslint-config-prettier eslint-plugin-googleappsscript eslint-plugin-prettier prettier
$> curl https://raw.githubusercontent.com/gasru/google-apps-script-eslint-env/master/.eslintrc.json --output .eslintrc.json
$> curl https://raw.githubusercontent.com/gasru/google-apps-script-eslint-env/master/.prettierrc --output .prettierrc

Проверка правок

После внесения изменений в файл src/Code.js можно запустить перепроверку

$> npm run re-run-fix

Автоавершение кода

Следующие условия необходимы:

  • Node.js
  • TSServer engine. Входит в состав TypeScript SDK npm install -g typescript

MS Code

alt

Vim совместно с плагином YouCompleteMe

alt

Atom совместно с плагинами atom-ide-ui и ide-typescript

alt