New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@silvermine/eslint-plugin-silvermine

Package Overview
Dependencies
Maintainers
3
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@silvermine/eslint-plugin-silvermine - npm Package Compare versions

Comparing version 2.0.0-preview.1 to 2.0.0

10

.eslintrc.json

@@ -5,3 +5,11 @@ {

},
"extends": "@silvermine/eslint-config/node"
"extends": "@silvermine/eslint-config/node",
"rules": {
"prefer-template": "off",
"padding-line-between-statements": [
"error",
{ "blankLine": "any", "prev": [ "*" ], "next": "return" }
]
}
}

6

package.json
{
"name": "@silvermine/eslint-plugin-silvermine",
"version": "2.0.0-preview.1",
"version": "2.0.0",
"description": "eslint plugins to support our JS Code Standards. See @silvermine/eslint-config-silvermine",

@@ -26,3 +26,3 @@ "scripts": {

"dependencies": {
"@silvermine/eslint-config": "1.5.0",
"@silvermine/eslint-config": "2.0.0-preview.2",
"class.extend": "0.9.2",

@@ -37,3 +37,3 @@ "lodash.assign": "4.2.0",

"coveralls": "3.0.2",
"eslint": "4.19.1",
"eslint": "5.10.0",
"grunt": "1.0.3",

@@ -40,0 +40,0 @@ "grunt-cli": "1.2.0",

@@ -12,6 +12,6 @@ /**

formatCode = require('../../code-helper'),
RuleTester = require('eslint').RuleTester,
ruleTester = new RuleTester(),
validExample, switchTest, constExample,
invalidExample, invalidExample2, invalidExample3, constInvalid;
ruleTester = require('../../ruleTesters').es6(),
validExample, varOnlyExample, switchTest, constExample, flatTernaryValid,
invalidExample, invalidExample2, invalidExample3, constInvalid,
classInvalid;

@@ -38,2 +38,3 @@ validExample = formatCode(

'',
' // This comment should be indented with the if statement',
' if (noInit) {',

@@ -43,5 +44,60 @@ ' var a = 1,',

' }',
'}'
'}',
'',
'class MyClass {',
' /**',
' * This should be indented with the function.',
' *',
' * @param {number} num base number to add',
' */',
' constructor(num) {',
' this.a = num;',
' }',
'',
' add(b) {',
' return this.a + b;',
' }',
'}',
'',
'const myClass = new MyClass();',
'',
'for (let i = 1; i < 10; i++) {',
' console.log(i);',
'}',
'',
'myFunc().then((var1) => {',
' return doSomething(var1);',
'});',
'',
'myFunc(',
' myClass,',
' a,',
' b,',
' c',
');',
'',
'try {',
' myFunc();',
'} catch (err) {',
' console.error(err);',
'}',
'',
'(function() {',
' doSomethingNow();',
'})();'
);
varOnlyExample = formatCode(
'var a = 1,',
' b = 2,',
' c = 3;'
);
flatTernaryValid = formatCode(
'var a =',
' foo > 0 ? bar :',
' foo < 0 ? baz :',
' qiz;'
);
invalidExample = formatCode(

@@ -53,3 +109,13 @@ 'function test() {',

' return a + b;',
'}'
'}',
'',
'myFunc(',
'myClass,',
'a',
');',
'',
'var foo = {',
' bar: 1,',
' baz: 2,',
'};'
);

@@ -83,3 +149,10 @@

'const A = 1,',
' B = 2;'
' B = 2;',
'',
'const myArr = [',
' {',
' a: 1,',
' b: 2,',
' },',
'];'
);

@@ -95,2 +168,14 @@

classInvalid = formatCode(
'class MyClass {',
'constructor(num) {',
' this.a = num;',
'}',
'',
'add(b) {',
' return this.a + b;',
'}',
'}'
);
// ------------------------------------------------------------------------------

@@ -115,2 +200,10 @@ // Tests

},
{
code: varOnlyExample,
options: [ 3, { 'VariableDeclaratorOffset': 1 } ],
},
{
code: flatTernaryValid,
options: [ 3, { 'flatTernaryExpressions': true } ],
},
],

@@ -123,5 +216,17 @@

{
message: 'Expected indentation of 7 space characters but found 6.',
type: 'VariableDeclarator',
message: 'Expected indentation of 7 spaces but found 6.',
type: 'Identifier',
},
{
message: 'Expected indentation of 3 spaces but found 0.',
type: 'Identifier',
},
{
message: 'Expected indentation of 3 spaces but found 0.',
type: 'Identifier',
},
{
message: 'Expected indentation of 3 spaces but found 2.',
type: 'Identifier',
},
],

@@ -134,4 +239,4 @@ options: [ 3, { 'VariableDeclaratorOffset': { 'var': 1, 'let': 1, 'const': 3 }, 'SwitchCase': 1 } ],

{
message: 'Expected indentation of 3 space characters but found 2.',
type: 'ExpressionStatement',
message: 'Expected indentation of 3 spaces but found 2.',
type: 'Identifier',
},

@@ -145,4 +250,4 @@ ],

{
message: 'Expected indentation of 3 space characters but found 0.',
type: 'ExpressionStatement',
message: 'Expected indentation of 3 spaces but found 0.',
type: 'Identifier',
},

@@ -156,16 +261,16 @@ ],

{
message: 'Expected indentation of 0 space characters but found 3.',
type: 'SwitchCase',
message: 'Expected indentation of 0 spaces but found 3.',
type: 'Keyword',
},
{
message: 'Expected indentation of 3 space characters but found 6.',
type: 'BreakStatement',
message: 'Expected indentation of 3 spaces but found 6.',
type: 'Keyword',
},
{
message: 'Expected indentation of 0 space characters but found 3.',
type: 'SwitchCase',
message: 'Expected indentation of 0 spaces but found 3.',
type: 'Keyword',
},
{
message: 'Expected indentation of 3 space characters but found 6.',
type: 'ExpressionStatement',
message: 'Expected indentation of 3 spaces but found 6.',
type: 'Identifier',
},

@@ -179,8 +284,8 @@ ],

{
message: 'Expected indentation of 6 space characters but found 3.',
type: 'VariableDeclarator',
message: 'Expected indentation of 6 spaces but found 3.',
type: 'Identifier',
},
{
message: 'Expected indentation of 6 space characters but found 4.',
type: 'VariableDeclarator',
message: 'Expected indentation of 6 spaces but found 4.',
type: 'Identifier',
},

@@ -191,3 +296,34 @@ ],

},
{
code: classInvalid,
errors: [
{
message: 'Expected indentation of 3 spaces but found 0.',
type: 'Identifier',
},
{
message: 'Expected indentation of 6 spaces but found 3.',
type: 'Keyword',
},
{
message: 'Expected indentation of 3 spaces but found 0.',
type: 'Punctuator',
},
{
message: 'Expected indentation of 3 spaces but found 0.',
type: 'Identifier',
},
{
message: 'Expected indentation of 6 spaces but found 3.',
type: 'Keyword',
},
{
message: 'Expected indentation of 3 spaces but found 0.',
type: 'Punctuator',
},
],
options: [ 3, { 'VariableDeclaratorOffset': { 'var': 1, 'let': 1, 'const': 3 }, 'SwitchCase': 1 } ],
parserOptions: { ecmaVersion: 6 },
},
],
});

Sorry, the diff of this file is too big to display

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