Skip to content

Commit

Permalink
Merge pull request #22 from schmidtk/feat-import-plugin
Browse files Browse the repository at this point in the history
feat(import): add import rules that meet current style
  • Loading branch information
schmidtk authored Sep 16, 2021
2 parents bbea7db + ec806f1 commit 18699b7
Show file tree
Hide file tree
Showing 3 changed files with 403 additions and 4 deletions.
23 changes: 22 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
"use strict";

module.exports = {
"extends": "google",
"extends": [
"google",
"plugin:import/recommended"
],
"plugins": [
"google-camelcase",
"import",
"jsdoc",
"opensphere"
],
Expand Down Expand Up @@ -71,6 +75,23 @@ module.exports = {
//
"prefer-promise-reject-errors": "off",

//
// Custom rules from eslint-plugin-import
//

// Warn when importing something marked as @deprecated
"import/no-deprecated": "warn",

// Do not allow importing using an absolute path (ie, '/some/path')
"import/no-absolute-path": "error",
// Do not allow relative paths to sibling projects (ie, '../some-project/src/index.js')
"import/no-relative-packages": "error",
// Do not allow relative paths to parents (ie, use full module path instead of '../')
// TODO: This is a breaking change from how we have been handling imports, and should be enabled in a major release.
// "import/no-relative-parent-imports": "error",
// Do not allow a module to import itself
"import/no-self-import": "error",

//
// Custom rules from eslint-plugin-opensphere
//
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"dependencies": {
"eslint-config-google": "^0.14.0",
"eslint-plugin-google-camelcase": "^0.0.2",
"eslint-plugin-import": "^2.24.2",
"eslint-plugin-jsdoc": "^36.0.6",
"eslint-plugin-opensphere": "^2.5.0"
},
Expand Down
Loading

0 comments on commit 18699b7

Please sign in to comment.