Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

eslint-plugin-canonical

Package Overview
Dependencies
Maintainers
1
Versions
75
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-canonical - npm Package Compare versions

Comparing version 2.5.0 to 2.6.0

4

dist/index.js

@@ -28,4 +28,2 @@ "use strict";

var _preferInlineTypeImport = _interopRequireDefault(require("./rules/preferInlineTypeImport"));
var _sortKeys = _interopRequireDefault(require("./rules/sortKeys"));

@@ -49,3 +47,2 @@

'no-use-extend-native': _noUseExtendNative.default,
'prefer-inline-type-import': _preferInlineTypeImport.default,
'sort-keys': _sortKeys.default

@@ -63,3 +60,2 @@ },

'no-use-extend-native': 0,
'prefer-inline-type-import': 0,
'sort-keys': 0

@@ -66,0 +62,0 @@ }

6

dist/rules/filenameMatchExported.js

@@ -8,3 +8,3 @@ "use strict";

var _nodePath = _interopRequireDefault(require("node:path"));
var _path = _interopRequireDefault(require("path"));

@@ -40,3 +40,3 @@ var _lodash = require("lodash");

const getStringToCheckAgainstExport = (parsed, replacePattern) => {
const dirArray = parsed.dir.split(_nodePath.default.sep);
const dirArray = parsed.dir.split(_path.default.sep);
const lastDirectory = dirArray[dirArray.length - 1];

@@ -87,3 +87,3 @@

const absoluteFilename = _nodePath.default.resolve(filename);
const absoluteFilename = _path.default.resolve(filename);

@@ -90,0 +90,0 @@ const parsed = (0, _parseFilename.parseFilename)(absoluteFilename);

@@ -8,3 +8,3 @@ "use strict";

var _nodePath = _interopRequireDefault(require("node:path"));
var _path = _interopRequireDefault(require("path"));

@@ -33,3 +33,3 @@ var _getExportedName = require("../utilities/getExportedName");

const absoluteFilename = _nodePath.default.resolve(filename);
const absoluteFilename = _path.default.resolve(filename);

@@ -36,0 +36,0 @@ const parsed = (0, _parseFilename.parseFilename)(absoluteFilename);

@@ -8,3 +8,3 @@ "use strict";

var _nodePath = _interopRequireDefault(require("node:path"));
var _path = _interopRequireDefault(require("path"));

@@ -28,3 +28,3 @@ var _isIgnoredFilename = require("../utilities/isIgnoredFilename");

const absoluteFilename = _nodePath.default.resolve(filename);
const absoluteFilename = _path.default.resolve(filename);

@@ -31,0 +31,0 @@ const parsed = (0, _parseFilename.parseFilename)(absoluteFilename);

@@ -8,3 +8,3 @@ "use strict";

var _nodePath = _interopRequireDefault(require("node:path"));
var _path = _interopRequireDefault(require("path"));

@@ -14,9 +14,9 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

const parseFilename = filename => {
const ext = _nodePath.default.extname(filename);
const ext = _path.default.extname(filename);
return {
base: _nodePath.default.basename(filename),
dir: _nodePath.default.dirname(filename),
base: _path.default.basename(filename),
dir: _path.default.dirname(filename),
ext,
name: _nodePath.default.basename(filename, ext)
name: _path.default.basename(filename, ext)
};

@@ -23,0 +23,0 @@ };

@@ -17,14 +17,13 @@ {

"devDependencies": {
"@babel/cli": "^7.17.6",
"@babel/core": "^7.17.9",
"@babel/eslint-parser": "^7.17.0",
"@babel/node": "^7.16.8",
"@babel/plugin-transform-react-jsx": "^7.17.3",
"@babel/preset-env": "^7.16.11",
"@typescript-eslint/parser": "^5.18.0",
"@babel/cli": "^7.16.0",
"@babel/core": "^7.16.5",
"@babel/eslint-parser": "^7.16.5",
"@babel/node": "^7.16.5",
"@babel/plugin-transform-react-jsx": "^7.16.5",
"@babel/preset-env": "^7.16.5",
"ajv": "^8.8.2",
"babel-plugin-add-module-exports": "^1.0.4",
"eclint": "^2.8.1",
"eslint": "^8.12.0",
"eslint-config-canonical": "^33.0.1",
"eslint": "^8.5.0",
"eslint-config-canonical": "^32.46.1",
"eslint-plugin-eslint-plugin": "^4.1.0",

@@ -40,3 +39,3 @@ "gitdown": "^3.1.4",

"engines": {
"node": ">=14.0.0"
"node": ">=12.0.0"
},

@@ -52,3 +51,3 @@ "keywords": [

"peerDependencies": {
"eslint": "^8.12.0"
"eslint": "^8.5.0"
},

@@ -69,3 +68,3 @@ "repository": {

},
"version": "2.5.0"
"version": "2.6.0"
}

@@ -24,3 +24,2 @@ <a name="eslint-plugin-canonical"></a>

* [`no-use-extend-native`](#eslint-plugin-canonical-rules-no-use-extend-native)
* [`prefer-inline-type-import`](#eslint-plugin-canonical-rules-prefer-inline-type-import)
* [`sort-keys`](#eslint-plugin-canonical-rules-sort-keys)

@@ -1206,24 +1205,2 @@

<a name="eslint-plugin-canonical-rules-prefer-inline-type-import"></a>
### <code>prefer-inline-type-import</code>
_The `--fix` option on the command line automatically fixes problems reported by this rule._
TypeScript 4.5 introduced [type modifiers](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-5.html#type-modifiers-on-import-names) that allow to inline type imports as opposed to having dedicated `import type`. This allows to remove duplicate type imports. This rule enforces use of import type modifiers.
The following patterns are considered problems:
```js
import type {foo} from 'bar'
// Message: undefined
```
The following patterns are not considered problems:
```js
import {type foo} from 'bar'
```
<a name="eslint-plugin-canonical-rules-sort-keys"></a>

@@ -1230,0 +1207,0 @@ ### <code>sort-keys</code>

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc