From 1f4d8c1552f91c0829d4f35368be49c9f466e7d5 Mon Sep 17 00:00:00 2001 From: Peter deHaan Date: Fri, 22 Sep 2017 16:38:23 -0700 Subject: [PATCH] Initialize --- .gitignore | 1 + configs/datastore.js | 8 ++++++++ configs/extension.js | 23 +++++++++++++++++++++++ configs/recommended.js | 21 +++++++++++++++++++++ index.js | 8 ++++++++ package.json | 23 +++++++++++++++++++++++ 6 files changed, 84 insertions(+) create mode 100644 .gitignore create mode 100644 configs/datastore.js create mode 100644 configs/extension.js create mode 100644 configs/recommended.js create mode 100644 index.js create mode 100644 package.json diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3c3629e --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +node_modules diff --git a/configs/datastore.js b/configs/datastore.js new file mode 100644 index 0000000..1151be8 --- /dev/null +++ b/configs/datastore.js @@ -0,0 +1,8 @@ +module.exports = { + env: { + commonjs: true, + }, + extends: [ + "plugin:mozilla-lockbox/recommended", + ], +}; diff --git a/configs/extension.js b/configs/extension.js new file mode 100644 index 0000000..9d8e013 --- /dev/null +++ b/configs/extension.js @@ -0,0 +1,23 @@ +module.exports = { + env: { + node: true, + webextensions: true, + }, + extends: [ + "plugin:mozilla-lockbox/recommended", + "plugin:mozilla/recommended", + "plugin:react/recommended", + ], + parserOptions: { + ecmaFeatures: { + experimentalObjectRestSpread: true, + jsx: true, + }, + ecmaVersion: 2017, + sourceType: "module", + }, + plugins: [ + "mozilla", + "react", + ], +}; diff --git a/configs/recommended.js b/configs/recommended.js new file mode 100644 index 0000000..f50b4ca --- /dev/null +++ b/configs/recommended.js @@ -0,0 +1,21 @@ +module.exports = { + env: { + browser: true, + es6: true, + }, + extends: [ + "eslint:recommended", + ], + parserOptions: { + ecmaVersion: 2017, + }, + rules: { + "comma-dangle": ["error", "always-multiline"], + "curly": "error", + "indent": ["error", 2, {SwitchCase: 1, VariableDeclarator: {var: 2, let: 2, const: 3}}], + "linebreak-style": ["error", "unix"], + "no-console": "warn", + "quotes": ["error", "double"], + "semi": ["error", "always"], + } +}; diff --git a/index.js b/index.js new file mode 100644 index 0000000..f973d53 --- /dev/null +++ b/index.js @@ -0,0 +1,8 @@ +module.exports = { + rules: [], + configs: { + recommended: require('./configs/recommended'), + datastore: require('./configs/datastore'), + extension: require('./configs/extension'), + } +}; diff --git a/package.json b/package.json new file mode 100644 index 0000000..66d5540 --- /dev/null +++ b/package.json @@ -0,0 +1,23 @@ +{ + "name": "eslint-plugin-mozilla-lockbox", + "version": "1.0.0", + "author": "Lockbox Team ", + "bugs": { + "url": "https://github.com/mozilla-lockbox/eslint-plugin-mozilla-lockbox/issues" + }, + "homepage": "https://github.com/mozilla-lockbox/eslint-plugin-mozilla-lockbox#readme", + "keywords": [], + "license": "MPL-2.0", + "main": "index.js", + "repository": { + "type": "git", + "url": "git+https://github.com/mozilla-lockbox/eslint-plugin-mozilla-lockbox.git" + }, + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "dependencies": { + "eslint-plugin-mozilla": "^0.4.4", + "eslint-plugin-react": "^7.3.0" + } +}