Skip to content

Commit

Permalink
Drop babel (#2134)
Browse files Browse the repository at this point in the history
Drop babel
  • Loading branch information
davidtheclark committed Nov 30, 2016
1 parent bcf5600 commit 43df9d6
Show file tree
Hide file tree
Showing 1,239 changed files with 58,636 additions and 61,595 deletions.
1 change: 0 additions & 1 deletion .eslintignore
@@ -1,3 +1,2 @@
dist
.nyc_output .nyc_output
decls decls
15 changes: 8 additions & 7 deletions .eslintrc
@@ -1,21 +1,22 @@
{ {
"extends": [ "extends": [
"stylelint", "stylelint"
"plugin:flowtype/recommended"
], ],
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "script"
},
"env": { "env": {
"jest": true "jest": true
}, },
"parser": "babel-eslint",
"plugins": [
"flowtype"
],
"rules": { "rules": {
"arrow-spacing": 2, "arrow-spacing": 2,
"no-var": 2, "no-var": 2,
"object-shorthand": 2, "object-shorthand": 2,
"prefer-const": 2, "prefer-const": 2,
"sort-imports": 2, "sort-imports": 2,
"template-curly-spacing": 2 "template-curly-spacing": 2,
"strict": ["error", "global"],
"spaced-comment": 0
} }
} }
1 change: 0 additions & 1 deletion .gitignore
@@ -1,4 +1,3 @@
node_modules node_modules
dist
*.log *.log
.nyc_output .nyc_output
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -9,7 +9,7 @@ matrix:
script: npm run lint && npm run flow script: npm run lint && npm run flow
env: CI=lint+flow env: CI=lint+flow
- node_js: '6' - node_js: '6'
script: npm run jest script: npm run jest-ci
env: CI=jest env: CI=jest
- node_js: '7' - node_js: '7'
script: npm run test script: npm run test
Expand Down
3 changes: 3 additions & 0 deletions bin/stylelint
@@ -0,0 +1,3 @@
#!/usr/bin/env node

require('../lib/cli');
2 changes: 1 addition & 1 deletion docs/developer-guide/plugins.md
Expand Up @@ -78,7 +78,7 @@ In addition to the standard parsers mentioned in the ["Working on rules"](rules.
- [postcss-resolve-nested-selector](https://github.com/davidtheclark/postcss-resolve-nested-selector): Given a (nested) selector in a PostCSS AST, return an array of resolved selectors. - [postcss-resolve-nested-selector](https://github.com/davidtheclark/postcss-resolve-nested-selector): Given a (nested) selector in a PostCSS AST, return an array of resolved selectors.
- [style-search](https://github.com/davidtheclark/style-search): Search CSS (and CSS-like) strings, with sensitivity to whether matches occur inside strings, comments, and functions. - [style-search](https://github.com/davidtheclark/style-search): Search CSS (and CSS-like) strings, with sensitivity to whether matches occur inside strings, comments, and functions.


Have a look through [stylelint's internal utils](https://github.com/stylelint/stylelint/tree/master/src/utils) and if you come across one that you need in your plugin, then please consider helping us extract it out into a external module. Have a look through [stylelint's internal utils](https://github.com/stylelint/stylelint/tree/master/lib/utils) and if you come across one that you need in your plugin, then please consider helping us extract it out into a external module.


## Testing plugins ## Testing plugins


Expand Down
4 changes: 2 additions & 2 deletions docs/developer-guide/rule-testers.md
Expand Up @@ -10,7 +10,7 @@ When developing plugins, you can use the following rule testers or create your o
- stylelint-test-rule-mocha - stylelint-test-rule-mocha
- stylelint-test-rule-ava - stylelint-test-rule-ava


The rule tester used within the stylelint codebase is at `src/testUtils/testRule.js`. (It is the same as `stylelint-test-rule-tape`.) The rule tester used within the stylelint codebase is at `lib/testUtils/testRule.js`. (It is the same as `stylelint-test-rule-tape`.)


## Using a rule tester ## Using a rule tester


Expand Down Expand Up @@ -48,7 +48,7 @@ Required properties:
Optional properties: Optional properties:


- `syntax` {"css"|"less"|"scss"|"sugarss"}: Defaults to `"css"`. Other settings use special parsers. - `syntax` {"css"|"less"|"scss"|"sugarss"}: Defaults to `"css"`. Other settings use special parsers.
- `skipBasicChecks` {boolean}: Defaults to `false`. If `true`, a few rudimentary checks (that should almost always be included) will not be performed. You can check those out in `src/testUtils/basicChecks.js`. - `skipBasicChecks` {boolean}: Defaults to `false`. If `true`, a few rudimentary checks (that should almost always be included) will not be performed. You can check those out in `lib/testUtils/basicChecks.js`.
- `preceedingPlugins` {array}: An array of PostCSS plugins that should be run before the CSS is tested. - `preceedingPlugins` {array}: An array of PostCSS plugins that should be run before the CSS is tested.


## Creating a rule tester ## Creating a rule tester
Expand Down
6 changes: 3 additions & 3 deletions docs/developer-guide/rules.md
Expand Up @@ -98,7 +98,7 @@ You will use the simple [PostCSS API](http://api.postcss.org/) to navigate and a


Depending on the rule, we also recommend using [postcss-value-parser](https://github.com/TrySound/postcss-value-parser) and [postcss-selector-parser](https://github.com/postcss/postcss-selector-parser). There are significant benefits to using these parsers instead of regular expressions or `indexOf` searches (even if they aren't always the most performant method). Depending on the rule, we also recommend using [postcss-value-parser](https://github.com/TrySound/postcss-value-parser) and [postcss-selector-parser](https://github.com/postcss/postcss-selector-parser). There are significant benefits to using these parsers instead of regular expressions or `indexOf` searches (even if they aren't always the most performant method).


stylelint has a number of [utility functions](https://github.com/stylelint/stylelint/tree/master/src/utils) that are used in existing rules and might prove useful to you, as well. Please look through those so that you know what's available. (And if you have a new function that you think might prove generally helpful, let's add it to the list!) stylelint has a number of [utility functions](https://github.com/stylelint/stylelint/tree/master/lib/utils) that are used in existing rules and might prove useful to you, as well. Please look through those so that you know what's available. (And if you have a new function that you think might prove generally helpful, let's add it to the list!)


In particular, you will definitely want to use `validateOptions()` so that users are warned about invalid options. (Looking at other rules for examples of options validation will help a lot.) In particular, you will definitely want to use `validateOptions()` so that users are warned about invalid options. (Looking at other rules for examples of options validation will help a lot.)


Expand Down Expand Up @@ -147,7 +147,7 @@ However, this runs all 25,000+ unit tests and also linting.
To run tests in a single file only (which you'll want to do during development), you'll need to use `babel-tape-runner` (because the codebase is ES6). For example, to run the test for the `color-hex-case` rule: To run tests in a single file only (which you'll want to do during development), you'll need to use `babel-tape-runner` (because the codebase is ES6). For example, to run the test for the `color-hex-case` rule:


```console ```console
./node_modules/.bin/babel-tape-runner src/rules/color-hex-case/__tests__/index.js ./node_modules/.bin/babel-tape-runner lib/rules/color-hex-case/__tests__/index.js
``` ```


### Write the README ### Write the README
Expand Down Expand Up @@ -189,7 +189,7 @@ Take the form of:


The final step is to add references to the new rule in the following places: The final step is to add references to the new rule in the following places:


- [The rules `index.js` file](https://github.com/stylelint/stylelint/blob/master/src/rules/index.js) - [The rules `index.js` file](https://github.com/stylelint/stylelint/blob/master/lib/rules/index.js)
- [The list of rules](../user-guide/rules.md) - [The list of rules](../user-guide/rules.md)
- [The example config](../user-guide/example-config.md) - [The example config](../user-guide/example-config.md)


Expand Down
2 changes: 1 addition & 1 deletion docs/user-guide/css-processors.md
Expand Up @@ -39,7 +39,7 @@ postcss([
require("reporter") require("reporter")
]) ])
.process(css, { .process(css, {
from: "src/app.css", from: "lib/app.css",
syntax: scss syntax: scss
}) })
}) })
Expand Down
4 changes: 2 additions & 2 deletions docs/user-guide/postcss-plugin.md
Expand Up @@ -101,7 +101,7 @@ var postcss = require("postcss")
var stylelint = require("stylelint") var stylelint = require("stylelint")


// CSS to be processed // CSS to be processed
var css = fs.readFileSync("src/app.css", "utf8") var css = fs.readFileSync("lib/app.css", "utf8")


postcss( postcss(
processors: [ processors: [
Expand All @@ -114,7 +114,7 @@ postcss(
require("postcss-reporter")({ clearMessages: true }) require("postcss-reporter")({ clearMessages: true })
] ]
) )
.process(css, { from: 'src/app.css', to: 'app.css' }) .process(css, { from: 'lib/app.css', to: 'app.css' })
.then(function (result) { .then(function (result) {
fs.writeFileSync('app.css', result.css); fs.writeFileSync('app.css', result.css);
if ( result.map ) fs.writeFileSync('app.css.map', result.map); if ( result.map ) fs.writeFileSync('app.css.map', result.map);
Expand Down

0 comments on commit 43df9d6

Please sign in to comment.