Skip to content

Commit

Permalink
Build: use JS for eslint config
Browse files Browse the repository at this point in the history
- this makes it easier to use this config in esm
  eslint.config.js
  • Loading branch information
timmywil committed Jul 11, 2023
1 parent 1c12c77 commit 818af3b
Show file tree
Hide file tree
Showing 6 changed files with 133 additions and 171 deletions.
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
}
};
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "eslint-config-jquery",
"version": "3.0.0",
"description": "jQuery eslint config",
"main": ".eslintrc.json",
"main": "index.js",
"scripts": {
"test": "eslint test/fixtures/*.js"
},
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"
}
};

0 comments on commit 818af3b

Please sign in to comment.