nakarte

Source code of https://map.sikmir.ru (fork)
git clone git://git.sikmir.ru/nakarte
Log | Files | Refs | LICENSE

commit b40721cb0edfb53b47c843128af2c92c41f83d1a
parent 7e78db02daa022cf405ed259354b7b8055bd835a
Author: Sergej Orlov <wladimirych@gmail.com>
Date:   Sat,  4 Jan 2020 19:18:54 +0100

eslint: join configs from sepate files in one config, defining overrides

Diffstat:
M.eslintrc | 92++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---------------------
Dscripts/.eslintrc | 6------
Dsrc/vendored/.eslintrc | 6------
Dtest/.eslintrc | 9---------
Dwebpack/.eslintrc | 6------
5 files changed, 68 insertions(+), 51 deletions(-)

diff --git a/.eslintrc b/.eslintrc @@ -2,27 +2,72 @@ "root": true, "ignorePatterns": [ "node_modules", - "build" + "build", + "deploy" ], - "env": { - "browser": true, - "es2020": true, - "commonjs": true - }, - "parser": "babel-eslint", - "extends": "eslint:recommended", - "parserOptions": { - "sourceType": "module" - }, - "rules": { - "no-unused-vars": ["error", {"argsIgnorePattern": "_unused(_.+)?"}], - "no-constant-condition": ["error", {"checkLoops": false}], // allow `while (true)` - "no-prototype-builtins": "off", - "semi": "error", // missing in eslint:recommended - "eol-last": "error" // missing in eslint:recommended - }, - "globals": { - "NODE_ENV": true, - "RELEASE_VER": true - } -} -\ No newline at end of file + "extends": [ + "eslint:recommended" + ], + "overrides": [ + { + "files": "src/**/*.js", + "env": { + "browser": true, + "es2020": true, + "commonjs": true + }, + "parser": "babel-eslint", + "parserOptions": { + "sourceType": "module" + }, + "rules": { + "no-unused-vars": ["error", {"argsIgnorePattern": "_unused(_.+)?"}], + "no-constant-condition": ["error", {"checkLoops": false}], // allow `while (true)` + "no-prototype-builtins": "off", + "semi": "error", // missing in eslint:recommended + "eol-last": "error" // missing in eslint:recommended + }, + "globals": { + "NODE_ENV": true, + "RELEASE_VER": true + } + }, + { + "files": "src/vendored/**/*.js", + "rules": { + "semi": "off" + } + }, + { + "files": "test/**/*.js", + "excludedFiles": "test/karma.conf.js", + "parser": "babel-eslint", + "env": { + "browser": true, + "mocha": true, + "es2020": true + }, + "parserOptions": { + "sourceType": "module" + }, + "rules": { + "semi": "error", // missing in eslint:recommended + "eol-last": "error" // missing in eslint:recommended + }, + "globals": { + "assert": true + } + }, + { + "files": [ + "webpack/**/*.js", + "test/karma.conf.js", + "scripts/**/*.js" + ], + "env": { + "node": true, + "es2017": true + } + } + ] +} diff --git a/scripts/.eslintrc b/scripts/.eslintrc @@ -1,5 +0,0 @@ -{ - "env": { - "node": true - } -} -\ No newline at end of file diff --git a/src/vendored/.eslintrc b/src/vendored/.eslintrc @@ -1,5 +0,0 @@ -{ - "rules": { - "semi": "off" - } -} -\ No newline at end of file diff --git a/test/.eslintrc b/test/.eslintrc @@ -1,8 +0,0 @@ -{ - "env": { - "mocha": true - }, - "globals": { - "assert": true - } -} -\ No newline at end of file diff --git a/webpack/.eslintrc b/webpack/.eslintrc @@ -1,5 +0,0 @@ -{ - "env": { - "node": true - } -} -\ No newline at end of file