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

eslint-plugin-gjs

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-gjs - npm Package Compare versions

Comparing version 0.0.1 to 1.0.0

lib/rules/no-computed-properties.js

138

lib/index.js

@@ -5,3 +5,3 @@ /**

*/
"use strict";
'use strict';

@@ -12,3 +12,3 @@ //------------------------------------------------------------------------------

var requireIndex = require("requireindex");
var requireIndex = require('requireindex');

@@ -21,33 +21,63 @@ //------------------------------------------------------------------------------

// import all rules in lib/rules
const GJS_INDENT = 4;
const GJS_RULES = {
'comma': 'error',
'no-unreachable': 'error',
'no-undef': 'error',
'no-dupe-keys': 'error',
'keyword-spacing': 'error',
'space-before-function-paren': ['error', {
'anonymous': 'never',
'named': 'never',
'asyncArrow': 'always'
}],
'linebreak-style': ['error', 'unix'],
'object-shorthand': ['error', 'never'],
'space-before-blocks': ['error', 'always'],
'brace-style': ['error', '1tbs'],
'indent': ['error', GJS_INDENT],
'no-var': 'error',
'no-trailing-spaces': 'error',
'no-tabs': 'error',
'semi': 'error',
'gjs/no-computed-properties': 'error',
'gjs/no-generators': 'error',
'gjs/no-invalid-regexp': ['error', { 'allowConstructorFlags': ['y'] }],
'gjs/no-js-class': 'error',
'gjs/no-modules': 'error',
'gjs/no-numeric-literals': 'error',
'gjs/no-spread': 'error',
'gjs/no-super': 'error',
'gjs/no-template-strings': 'error',
'gjs/translation-strings': 'error'
};
const GJS_GLOBALS_BASE = {
'log': false,
'logError': false,
'print': false,
'printerr': false,
'imports': false,
'ARGV': false,
'global': false
};
module.exports = {
rules: requireIndex(__dirname + "/rules"),
rules: requireIndex(__dirname + '/rules'),
// import processors
processors: {},
environments: {
"application": {
globals: {
"log": false,
"logError": false,
"print": false,
"printerr": false,
"imports": false,
"ARGV": false,
"global": false,
"pkg": false,
"window": false
}
'application': {
globals: function () {
return Object.assign({
window: false,
pkg: false
}, GJS_GLOBALS_BASE);
} ()
},
"shell-extension": {
globals: {
"log": false,
"logError": false,
"print": false,
"printerr": false,
"imports": false,
"ARGV": false,
"global": false
}
'shell-extension': {
globals: GJS_GLOBALS_BASE
}

@@ -57,53 +87,19 @@ },

configs: {
"extension": {
plugin: ["gjs"],
'extension': {
plugin: ['gjs'],
env: {
"es6": true,
"gjs/shell-extension": true
'es6': true,
'gjs/shell-extension': true
},
rules: {
"no-undef": ["error"],
"keyword-spacing": ["error"],
"space-before-function-paren": ["error", {
"anonymous": "never",
"named": "never",
"asyncArrow": "always"
}],
"space-before-blocks": ["error", "always"],
"brace-style": ["error", "1tbs"],
"indent": ["error", 4],
"no-var": "error",
"no-trailing-spaces": "error",
"no-tabs": "error",
"semi": "error",
"gjs/translatable-strings": "error",
"gjs/unsupported-syntax": "error"
}
rules: GJS_RULES
},
"application": {
plugin: ["gjs"],
'application': {
plugin: ['gjs'],
env: {
"es6": true,
"gjs/application": true
'es6': true,
'gjs/application': true
},
rules: {
"no-undef": ["error"],
"keyword-spacing": ["error"],
"space-before-function-paren": ["error", {
"anonymous": "never",
"named": "never",
"asyncArrow": "always"
}],
"space-before-blocks": ["error", "always"],
"brace-style": ["error", "1tbs"],
"indent": ["error", 4],
"no-var": "error",
"no-trailing-spaces": "error",
"no-tabs": "error",
"semi": "error",
"gjs/translatable-strings": "error",
"gjs/unsupported-syntax": "error"
}
rules: GJS_RULES
}
}
};
{
"name": "eslint-plugin-gjs",
"version": "0.0.1",
"version": "1.0.0",
"description": "Adds compatibility for the GJS environment.",

@@ -8,3 +8,6 @@ "keywords": [

"eslintplugin",
"eslint-plugin"
"eslint-plugin",
"gnome",
"gjs",
"gnome-shell"
],

@@ -17,3 +20,4 @@ "author": "rockon999",

"dependencies": {
"requireindex": "~1.1.0"
"requireindex": "~1.1.0",
"espree": "^3.1.6"
},

@@ -27,3 +31,3 @@ "devDependencies": {

},
"license": "ISC"
"license": "MIT"
}
# eslint-plugin-gjs
Adds compatibility for the GJS environment.
Adds compatibility for the GJS (Gnome JavaScript) environment.

@@ -23,19 +23,20 @@ ## Installation

Add `gjs` to the plugins section of your `.eslintrc` configuration file. You can omit the `eslint-plugin-` prefix:
Add `gjs` to the plugins section of your `.eslintrc` configuration file.
Depending on your use case, add either `plugin:gjs/extension` or `plugin:gjs/application` to your extends section.
```json
{
"plugins": [
"gjs"
]
"plugins": ["gjs"],
"extends": [ "plugin:gjs/extension" ]
}
```
The plugin automatically imports all relevant rules. If you would like to avoid this, add `gjs/application` or `gjs/shell-extension` to your env section. Then remove `"extends": [ "plugin:gjs/extension" ]`.
Then configure the rules you want to use under the rules section.
```json
{
"rules": {
"gjs/rule-name": 2
"plugins": ["gjs"],
"env": {
"es6": true,
"gjs/application": true
}

@@ -47,7 +48,23 @@ }

* Fill in provided rules here
* gjs/no-computed-properties
* gjs/no-generators
* gjs/no-invalid-regexp
* gjs/no-js-class
* gjs/no-modules
* gjs/no-numeric-literals
* gjs/no-spread
* gjs/no-super
* gjs/no-template-strings
* gjs/translation-strings
* DEPRECATED: gjs/no-unsupported-syntax
# Not Implemented
* Lang.Class member formatting
* Object literal formatting (unlikely to be implemented)
* Lang.bind enforcement for closures

Sorry, the diff of this file is not supported yet

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