Skip to content

Build: use JS for eslint config #20

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
extends: "./index.js",
env: {
node: true
}
};
153 changes: 0 additions & 153 deletions .eslintrc.json

This file was deleted.

104 changes: 104 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
module.exports = {
rules: {
"no-negated-in-lhs": "error",
"no-cond-assign": [ "error", "except-parens" ],
curly: [ "error", "all" ],
"object-curly-spacing": [ "error", "always" ],
"computed-property-spacing": [ "error", "always" ],
"array-bracket-spacing": [ "error", "always" ],
eqeqeq: [ "error", "smart" ],
"no-unused-expressions": "error",
"no-sequences": "error",
"no-nested-ternary": "error",
"no-unreachable": "error",
"wrap-iife": [ "error", "inside" ],
"no-caller": "error",
quotes: [ "error", "double" ],
"no-undef": "error",
"no-unused-vars": [
"error",
{
args: "all",
argsIgnorePattern: "^_"
}
],
"operator-linebreak": [ "error", "after" ],
"comma-style": [ "error", "last" ],
camelcase: [
"error",
{
properties: "never"
}
],
"dot-notation": [
"error",
{
allowPattern: "^[a-z]+(_[a-z]+)+$"
}
],
"max-len": [
"error",
{
code: 100,
ignoreComments: true,
ignoreUrls: true,
ignoreRegExpLiterals: true
}
],
"no-mixed-spaces-and-tabs": "error",
"no-trailing-spaces": "error",
"no-irregular-whitespace": "error",
"no-multi-str": "error",
"comma-dangle": [ "error", "never" ],
"comma-spacing": [
"error",
{
before: false,
after: true
}
],
"space-before-blocks": [ "error", "always" ],
"space-in-parens": [ "error", "always" ],
"keyword-spacing": [ 2 ],
semi: [ "error", "always" ],
"semi-spacing": [
"error",
{

// Because of the `for ( ; ...)` requirement
// before: true,
after: true
}
],
"no-extra-semi": "error",
"space-infix-ops": "error",
"eol-last": "error",
"lines-around-comment": [
"error",
{
beforeLineComment: true
}
],
"linebreak-style": [ "error", "unix" ],
"no-with": "error",
"brace-style": "error",
"space-before-function-paren": [ "error", "never" ],
"no-loop-func": "error",
"no-spaced-func": "error",
"key-spacing": [
"error",
{
beforeColon: false,
afterColon: true
}
],
"space-unary-ops": [
"error",
{
words: false,
nonwords: false
}
],
"no-multiple-empty-lines": 2
}
};
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
"name": "eslint-config-jquery",
"version": "3.0.0",
"description": "jQuery eslint config",
"main": ".eslintrc.json",
"main": "index.js",
"scripts": {
"test": "eslint test/fixtures/*.js"
"test": "eslint ."
},
"repository": {
"type": "git",
Expand All @@ -21,7 +21,7 @@
"eslintconfig"
],
"files": [
".eslintrc.json"
"index.js"
],
"author": "Gaidarenko Oleg <markelog@gmail.com>",
"license": "MIT",
Expand Down
16 changes: 0 additions & 16 deletions test/fixtures/.eslintrc

This file was deleted.

21 changes: 21 additions & 0 deletions test/fixtures/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
module.exports = {
globals: {
window: true,
define: true,
module: true,
Symbol: false
},

extends: "../../.eslintrc.js",

root: true,

rules: {

// For the built version
// TODO: do not use the built version to check the code
"no-multiple-empty-lines": "off",
"max-len": "off",
"one-var": "off"
}
};